zabetak commented on code in PR #6515:
URL: https://github.com/apache/hive/pull/6515#discussion_r3372570279


##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartExprEvalUtils.java:
##########
@@ -82,9 +87,15 @@ static public Object evalExprWithPart(ExprNodeDesc expr, 
Partition p) throws Hiv
       partNames.add(entry.getKey());
       ObjectInspector oi = 
PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector
           (TypeInfoFactory.getPrimitiveTypeInfo(partKeyTypes[i++]));
-      partValues.add(ObjectInspectorConverters.getConverter(
-          PrimitiveObjectInspectorFactory.javaStringObjectInspector, oi)
-          .convert(entry.getValue()));
+
+      String partitionValue = entry.getValue();
+      if (partitionValue.equals(defaultPartitionName)) {
+        partValues.add(null); // Null for default partition.
+      } else {
+        partValues.add(ObjectInspectorConverters.getConverter(
+            PrimitiveObjectInspectorFactory.javaStringObjectInspector, oi)
+            .convert(partitionValue));
+      }

Review Comment:
   For the non-Iceberg case, there is still a bug in the NULL semantics:
   ```sql
   SELECT key, value, ds FROM pcr_t1 WHERE ds > 'A';
   ```
   The query returns C, D, B but for C the ds is `null` and `null > 'A'` should 
evaluate to `UNKNOWN` and thus `false`. If we consider that empty string `''` 
is also `null` then the query should only return the `B` value as it happens 
for Iceberg.
   
   There is a bit of inconsistency among the various predicates but I guess we 
can tackle this in another JIRA ticket assuming that this PR strictly target 
`IS NULL` predicate.



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