apurtell commented on code in PR #2523:
URL: https://github.com/apache/phoenix/pull/2523#discussion_r3405418669
##########
phoenix-core-client/src/main/java/org/apache/phoenix/parse/IndexExpressionParseNodeRewriter.java:
##########
@@ -90,9 +113,32 @@ public IndexExpressionParseNodeRewriter(PTable index,
String alias, PhoenixConne
@Override
protected ParseNode leaveCompoundNode(CompoundParseNode node,
List<ParseNode> children,
CompoundNodeFactory factory) {
- return indexedParseNodeToColumnParseNodeMap.containsKey(node)
- ? indexedParseNodeToColumnParseNodeMap.get(node)
- : super.leaveCompoundNode(node, children, factory);
+ ParseNode replacement = indexedParseNodeToColumnParseNodeMap.get(node);
+ if (replacement == null) {
+ return super.leaveCompoundNode(node, children, factory);
+ }
+ // A functional index substitution actually fired for this query node.
+ String[] functionalColumn = indexedParseNodeToFunctionalColumn.get(node);
+ if (functionalColumn != null) {
+ appliedFunctionalSubstitutions.put(functionalColumn[0],
functionalColumn[1]);
+ }
Review Comment:
This assumes the node in `leaveCompoundNode` is the user's query expression
as written, but it isn't. This suggestion degrades the readability of the
output.
--
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]