kasakrisz commented on code in PR #4697:
URL: https://github.com/apache/hive/pull/4697#discussion_r1327315857


##########
hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java:
##########
@@ -503,6 +509,19 @@ public static DecomposedPredicate decomposePredicate(
             continue;
           }
         }
+
+        // In HBase, Keys are sorted lexicographically so the byte 
representation of negative values comes after the positive values
+        // So don't pushdown the predicate if any constant value is a negative 
number.
+        // if first condition constant value is less than 0 then don't 
pushdown the predicate
+        if (((Number) 
searchConditions.get(0).getConstantDesc().getValue()).longValue() < 0 && scSize 
== 2) {

Review Comment:
   Maybe it is an edge case but can we have `searchConditions.empty()` ?
   How about checking `scSize == 2` first just for safety like in the next if 
statement at line 521?  



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