zratkai commented on code in PR #5541: URL: https://github.com/apache/hive/pull/5541#discussion_r1883961663
########## 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 think I would use "asJson" in a method name to express a transformation is happening like toString(), asJson(), asXML ect not in a variable name. -- 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