@Test
  public void testTruncateTableExternalPurgeFalse() throws IOException, TException, InterruptedException {
    // Create an Iceberg table with some records and set the 'external.table.purge' table parameter to false.
    // Then execute a truncate table command which should run without any error, even without force.
    // Then check if the data is deleted from the table and the statistics are reset.
    String databaseName = "default";
    String tableName = "customers";
    Table icebergTable = testTables.createTable(shell, tableName, HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA,
        fileFormat, HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS);
    testTruncateTable(databaseName, tableName, icebergTable, HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS,
        HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA, false, false);
  }
Tests truncate table feature on Iceberg tables.
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergTruncateTable.java