You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "stoty (via GitHub)" <gi...@apache.org> on 2023/09/14 05:50:45 UTC
[GitHub] [phoenix] stoty commented on a diff in pull request #1663: PHOENIX-6960 Scan range is incorrect when query desc columns
stoty commented on code in PR #1663:
URL: https://github.com/apache/phoenix/pull/1663#discussion_r1325387159
##########
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:
Makes sense, we cannot use values from the table for constructing scan filters on the rowkey (unless they are coming from uncorrelated subqueries, but those are effectively constants)
--
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: issues-unsubscribe@phoenix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org