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


##########
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:
   ````
   Non-Iceberg pcr_t1 (NULL and '' both land in ds=__HIVE_DEFAULT_PARTITION__):
   
     
┌────────────────┬─────────────────────────────────────────┬─────────────────────────────────────────┬─────────────────┐
     │     Query      │               WITHOUT fix               │               
 WITH fix                 │ Changed by fix? │
     
├────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┼─────────────────┤
     │ ds is null     │ (none) ❌   │ C    → d       │ ✅         │ C, D → 
ds=NULL                          │ ✅  fixed        │
     
├────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┼─────────────────┤
     │ ds is not null │ A, B                                    │ A, B          
                          │ no              │
     
├────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┼─────────────────┤
     │ ds = 'null'    │ B                                       │ B             
                          │ no              │
     
├────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┼─────────────────┤
     │ ds > 'A'       │ C, D, B → ds=__HIVE_DEFAULT_PARTITION__ │ C, D, B → 
ds=__HIVE_DEFAULT_PARTITION__ │ no              │
     
├────────────────┼─────────────────────────────────────────┼─────────────────────────────────────────┼─────────────────┤
     │ ds < 'A'       │ A                                       │ A             
                          │ no              │
     
└────────────────┴─────────────────────────────────────────┴─────────────────────────────────────────┴─────────────────┘
     
     Iceberg ice_01 (NULL → null partition; '' → real ds=''):
   
     ┌────────────────┬─────────────┬──────────┬─────────────────┐
     │     Query      │ WITHOUT fix │ WITH fix │ Changed by fix? │
     ├────────────────┼─────────────┼──────────┼─────────────────┤
     │ ds is null     │ (none) ❌   │ C        │ ✅ fixed─┘        │
     ├────────────────┼─────────────┼──────────┼─────────────────┤
     │ ds is not null │ A, B, D     │ A, B, D  │ no              │
     ├────────────────┼─────────────┼──────────┼─────────────────┤
     │ ds = 'null'    │ B           │ B        │ no              │
     ├────────────────┼─────────────┼──────────┼─────────────────┤
     │ ds > 'A'       │ B           │ B        │ no              │
     ├────────────────┼─────────────┼──────────┼─────────────────┤
     │ ds < 'A'       │ D, A        │ A, D     │ no (same set)   │
     └────────────────┴─────────────┴──────────┴─────────────────┘
   
   ````
    - Only IS NULL changed (both tables): non-Iceberg is null → C, D; Iceberg 
is null → C. Previously both returned nothing.
     - Range queries unchanged before/after — ds > 'A' and ds < 'A' are 
byte-identical to the baselines. No regression.
   
   



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