@Test
  public void testMultipleTruncateTable() throws IOException, TException, InterruptedException {
    // Create an Iceberg table with come records in it, then execute a truncate table command
    // and check the result. Then insert some new data and run an other truncate table command.
    // The purpose of this test is to make sure that multiple truncate table commands can
    // run after each other without any issue (like issues with locking).
    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, true, false);

    List<Record> newRecords = TestHelper.RecordsBuilder.newInstance(HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA)
        .add(3L, "Jane", "Purple").add(4L, "Tim", "Grey").add(5L, "Eva", "Yellow").add(6L, "James", "White")
        .add(7L, "Jack", "Black").build();
    shell.executeStatement("INSERT INTO default.customers values (3, 'Jane', 'Purple'), (4, 'Tim', 'Grey')," +
        "(5, 'Eva', 'Yellow'), (6, 'James', 'White'), (7, 'Jack', 'Black')");

    icebergTable = testTables.loadTable(TableIdentifier.of(databaseName, tableName));
    testTruncateTable(databaseName, tableName, icebergTable, newRecords,
        HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA, true, false);
  }
Tests truncate table feature on Iceberg tables.
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergTruncateTable.java