@ParameterizedTest(name = "TableCommitTest[withPrimaryKey={0}]")
    @ValueSource(booleans = {true, false})
    public void testTableCommit(boolean withPrimary) {
      TableBuilder builder =
          catalog.newTableBuilder(tableIdentifier, schema).withPartitionSpec(spec);
      if (withPrimary) {
        builder.withPrimaryKeySpec(keySpec);
      }
      // create mixed-iceberg
      builder.create();
      // assert table runtime exits
      assertTableRuntime(tableIdentifier, TableFormat.MIXED_ICEBERG);

      // load table
      MixedTable table = catalog.loadTable(tableIdentifier);

      // write and commit records.
      List<Record> expectedResult = writeTestData(table);

      table.refresh();
      // scan table records.
      List<Record> records = MixedDataTestHelpers.readTable(table, Expressions.alwaysTrue());
      Assertions.assertEquals(expectedResult.size(), records.size());
    }
write test records to the target table and return the expected records
amoro-ams/src/test/java/org/apache/amoro/server/TestInternalMixedCatalogService.java