rdblue commented on a change in pull request #1843:
URL: https://github.com/apache/iceberg/pull/1843#discussion_r536930840



##########
File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopTables.java
##########
@@ -200,6 +197,76 @@ TableOperations newTableOps(String location) {
     }
   }
 
+  private TableMetadata tableMetadata(Schema schema, PartitionSpec spec, 
SortOrder order,
+                                      Map<String, String> properties, String 
location) {
+    Preconditions.checkNotNull(schema, "A table schema is required");
+
+    Map<String, String> tableProps = properties == null ? ImmutableMap.of() : 
properties;
+    PartitionSpec partitionSpec = spec == null ? PartitionSpec.unpartitioned() 
: spec;
+    SortOrder sortOrder = order == null ? SortOrder.unsorted() : order;
+    return TableMetadata.newTableMetadata(schema, partitionSpec, sortOrder, 
location, tableProps);
+  }
+
+  /**
+   * Start a transaction to create a table.
+   *
+   * @param identifier a location for the table
+   * @param schema a schema
+   * @param spec a partition spec
+   * @param properties a string map of table properties
+   * @return a {@link Transaction} to create the table
+   * @throws AlreadyExistsException if the table already exists
+   */
+  public Transaction newCreateTableTransaction(

Review comment:
       Can this use `TableBuilder` instead? That would make the `SparkCatalog` 
implementation a lot cleaner because the code to configure the builder could be 
shared.
   
   I opened https://github.com/apache/iceberg/pull/1879 because tests would 
fail unless the builder is also supported in CachingCatalog.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to