deniskuzZ commented on code in PR #5541:
URL: https://github.com/apache/hive/pull/5541#discussion_r1884154984


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/Catalogs.java:
##########
@@ -140,15 +143,23 @@ public static Table createTable(Configuration conf, 
Properties props) {
     Map<String, String> map = filterIcebergTableProperties(props);
 
     Optional<Catalog> catalog = loadCatalog(conf, catalogName);
-
+    SortOrder sortOrder = getSortOrder(props, schema);
     if (catalog.isPresent()) {
       String name = props.getProperty(NAME);
       Preconditions.checkNotNull(name, "Table identifier not set");
-      return catalog.get().createTable(TableIdentifier.parse(name), schema, 
spec, location, map);
+      return catalog.get().buildTable(TableIdentifier.parse(name), 
schema).withPartitionSpec(spec)
+          
.withLocation(location).withProperties(map).withSortOrder(sortOrder).create();
     }
 
     Preconditions.checkNotNull(location, "Table location not set");
-    return new HadoopTables(conf).create(schema, spec, map, location);
+    return new HadoopTables(conf).create(schema, spec, sortOrder, map, 
location);
+  }
+
+  private static SortOrder getSortOrder(Properties props, Schema schema) {
+    String sortOrderJsonString = 
props.getProperty(InputFormatConfig.INSERT_WRITE_ORDER);

Review Comment:
   i don't insist, just saw this naming is used in iceberg



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to