zabetak commented on code in PR #6315:
URL: https://github.com/apache/hive/pull/6315#discussion_r2834542545
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelOptUtil.java:
##########
@@ -1107,7 +1107,14 @@ public static List<RelFieldCollation>
getNewRelFieldCollations(
Set<Integer> needed = new HashSet<>();
for (RelFieldCollation fc : sortCollation.getFieldCollations()) {
needed.add(fc.getFieldIndex());
- final RexNode node =
project.getProjects().get(map.getTarget(fc.getFieldIndex()));
+ int target = map.getTargetOpt(fc.getFieldIndex());
+ if (target == -1) {
+ // If there is no mapping for this field, we cannot push down the sort
+ LOG.debug("Missing target mapping for field index: {}. Cannot apply " +
+ "HiveProjectSort[Exchange]TransposeRule", fc.getFieldIndex());
Review Comment:
Yes, basically when we don't have `Rule [...] produced [...]` it basically
means that the rule didn't generate a new expression so some bail out logic
kicked in.
--
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]