ayushtkn commented on code in PR #5645:
URL: https://github.com/apache/hive/pull/5645#discussion_r1965414771


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java:
##########
@@ -97,22 +109,36 @@ private static Expression translate(ExpressionTree tree, 
List<PredicateLeaf> lea
    * @return Expression fully translated from Hive PredicateLeaf
    */
   private static Expression translateLeaf(PredicateLeaf leaf) {
-    String column = leaf.getColumnName();
+    TransformSpec transformSpec = 
TransformSpec.fromStringWithColumnName(leaf.getColumnName());
+    String column = transformSpec.getColumnName();
+    UnboundTerm<Object> columnTransform = getPartitionTransform(column, 
transformSpec);
+    boolean withoutTransform = columnTransform == null;
+
     switch (leaf.getOperator()) {
       case EQUALS:
-        Object literal = leafToLiteral(leaf);
-        return NaNUtil.isNaN(literal) ? isNaN(column) : equal(column, literal);
+        Object literal = leafToLiteral(leaf, transformSpec);
+        return NaNUtil.isNaN(literal) ?
+            (withoutTransform ? isNaN(column) : isNaN(columnTransform)) :

Review Comment:
   done



##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java:
##########
@@ -121,25 +147,50 @@ private static Expression translateLeaf(PredicateLeaf 
leaf) {
           return Expressions.alwaysTrue();
         }
       case IS_NULL:
-        return isNull(column);
+        return withoutTransform ? isNull(column) : isNull(columnTransform);
       default:
         throw new UnsupportedOperationException("Unknown operator: " + 
leaf.getOperator());
     }
   }
 
+  private static UnboundTerm<Object> getPartitionTransform(String columnName, 
TransformSpec transformSpec) {

Review Comment:
   done



##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java:
##########
@@ -155,6 +206,92 @@ private static Object leafToLiteral(PredicateLeaf leaf) {
     }
   }
 
+  private static Object getTransformedLiteral(Object literal, TransformSpec 
transform) {

Review Comment:
   done



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