public static TestTable create(
            File temp,
            String name,
            Schema schema,
            PartitionSpec spec,
            SortOrder sortOrder,
            int formatVersion) {
        TestTableOperations ops = new TestTableOperations(name, temp);
        if (ops.current() != null) {
            throw new AlreadyExistsException("Table %s already exists at location: %s", name, temp);
        }

        ops.commit(
                null,
                newTableMetadata(
                        schema, spec, sortOrder, temp.toString(),
                        ImmutableMap.of("format-version", String.valueOf(formatVersion))));

        return new TestTable(ops, name);
    }
Copy from iceberg-flink:iceberg-flink-1.15:1.1.x
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/iceberg/src/test/java/org/apache/inlong/sort/iceberg/sink/util/TestTables.java