@Test
  public void testStatsWithPessimisticLockInsertWhenHiveLockEnabled() {
    Assume.assumeTrue(testTableType == TestTables.TestTableType.HIVE_CATALOG);
    TableIdentifier identifier = getTableIdentifierWithPessimisticLock("true");
    String insert = testTables.getInsertQuery(HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS, identifier, false);
    AssertHelpers.assertThrows(
        "Should throw RuntimeException when Hive locking is on with 'engine.hive.lock-enabled=true'",
        RuntimeException.class,
        () -> shell.executeStatement(insert)
    );
  }
Tests verifying correct statistics generation behaviour on Iceberg tables triggered by: ANALYZE queries, inserts,
CTAS, etc...
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStatistics.java