deniskuzZ commented on code in PR #6256:
URL: https://github.com/apache/hive/pull/6256#discussion_r2660838422
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -624,12 +631,55 @@ private void
alterTableProperties(org.apache.hadoop.hive.metastore.api.Table hms
Map<String, String> hmsTableParameters = hmsTable.getParameters();
Splitter splitter = Splitter.on(PROPERTIES_SEPARATOR);
UpdateProperties icebergUpdateProperties = icebergTable.updateProperties();
+
if (contextProperties.containsKey(SET_PROPERTIES)) {
- splitter.splitToList(contextProperties.get(SET_PROPERTIES))
- .forEach(k -> icebergUpdateProperties.set(k,
hmsTableParameters.get(k)));
+ List<String> propertiesToSet =
splitter.splitToList(contextProperties.get(SET_PROPERTIES));
+
+ // Check if we are setting regular sort order as it needs conversion
from Hive JSON to Iceberg SortOrder
+ if (propertiesToSet.contains(TableProperties.DEFAULT_SORT_ORDER)) {
+ // If the HMS table has Hive SortFields JSON in default-sort-order
Review Comment:
maybe extract this logic into a separate method. also consider `Set` due to
use of contains
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]