kasakrisz commented on a change in pull request #2888:
URL: https://github.com/apache/hive/pull/2888#discussion_r772311718
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
##########
@@ -4025,7 +4025,9 @@ private OBLogicalPlanGenState beginGenOBLogicalPlan(
// replace each of the position alias in ORDERBY with the actual column
if (ref != null && ref.getToken().getType() == HiveParser.Number) {
if (isObyByPos) {
- fieldIndex = getFieldIndexFromColumnNumber(selectOutputRR, ref);
Review comment:
HIVE-24830 doesn't solve this.
When generating the Calcite plan of values queries the source of the `Order
by` is a `HiveTableFunctionScan` instead of a `Project`.
The `values` clause is converted to a function call and as a result we end
up with a `HiveTableFunctionScan`
https://github.com/apache/hive/blob/c39cc56e28172397d573ca9072f55551fef86a56/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java#L4606
This case the output RR is null:
https://github.com/apache/hive/blob/c39cc56e28172397d573ca9072f55551fef86a56/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java#L4870
--
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]