lcspinter commented on code in PR #3445:
URL: https://github.com/apache/hive/pull/3445#discussion_r925245767


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -334,24 +338,32 @@ public boolean supportsPartitionTransform() {
   public List<PartitionTransformSpec> 
getPartitionTransformSpec(org.apache.hadoop.hive.ql.metadata.Table hmsTable) {
     TableDesc tableDesc = Utilities.getTableDesc(hmsTable);
     Table table = IcebergTableUtil.getTable(conf, tableDesc.getProperties());
-    return table.spec().fields().stream().map(f -> {
-      PartitionTransformSpec spec = new PartitionTransformSpec();
-      spec.setColumnName(table.schema().findColumnName(f.sourceId()));
-      // right now the only way to fetch the transform type and its params is 
through the toString() call
-      String transformName = f.transform().toString().toUpperCase();
-      // if the transform name contains '[' it means it has some config params
-      if (transformName.contains("[")) {
-        spec.setTransformType(PartitionTransformSpec.TransformType
-            .valueOf(transformName.substring(0, transformName.indexOf("["))));
-        spec.setTransformParam(Optional.of(Integer
-            .valueOf(transformName.substring(transformName.indexOf("[") + 1, 
transformName.indexOf("]")))));
-      } else {
-        
spec.setTransformType(PartitionTransformSpec.TransformType.valueOf(transformName));
-        spec.setTransformParam(Optional.empty());
-      }
+    return table.spec().fields().stream().map(f ->
+      getTransformSpec(table, f.transform().toString().toUpperCase(), 
f.sourceId())
+    ).collect(Collectors.toList());
+  }
+
+  private List<PartitionTransformSpec> getSortTransformSpec(Table table) {

Review Comment:
   I will rename it to something more general, like `TransformSpec`.
   Yes, we are able to handle every kind of sort-order definition. 
   



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

Reply via email to