virajjasani commented on code in PR #1663:
URL: https://github.com/apache/phoenix/pull/1663#discussion_r1325383804


##########
phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java:
##########
@@ -1691,8 +1691,10 @@ public KeySlots visitLeave(LikeExpression node, 
List<KeySlots> childParts) {
             KeySlots childSlots = childParts.get(0);
             KeySlot childSlot = childSlots.getSlots().get(0);
             final String startsWith = node.getLiteralPrefix();
-            SortOrder sortOrder = node.getChildren().get(0).getSortOrder();
-            byte[] key = PVarchar.INSTANCE.toBytes(startsWith, sortOrder);
+            // TODO: is there a case where we'd need to go through the 
childPart to calculate the key range?
+            PColumn column = childSlot.getKeyPart().getColumn();
+            PDataType type = column.getDataType();
+            byte[] key = PVarchar.INSTANCE.toBytes(startsWith, SortOrder.ASC);

Review Comment:
   Even `col1 LIKE col2` doesn't seem to be working as childParts are coming 
empty, resulting in null KeySlots



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

Reply via email to