arina-ielchiieva commented on a change in pull request #1818: DRILL-7200:
Update Calcite to 1.19.0 / 1.20.0
URL: https://github.com/apache/drill/pull/1818#discussion_r299400307
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java
##########
@@ -403,8 +411,20 @@ public RelRoot toRel(final SqlNode validatedNode) {
new SqlToRelConverter(new Expander(), validator, catalog, cluster,
DrillConvertletTable.INSTANCE,
sqlToRelConverterConfig);
- //To avoid unexpected column errors set a value of top to false
- final RelRoot rel = sqlToRelConverter.convertQuery(validatedNode, false,
false);
+ RelRoot rel = sqlToRelConverter.convertQuery(validatedNode, false,
!isInnerQuery || isExpandedView);
+
+ // If extra expressions used in ORDER BY were added to the project list,
+ // add another project to remove them.
+ if ((!isInnerQuery || isExpandedView) &&
rel.rel.getRowType().getFieldCount() - rel.fields.size() > 0) {
+ List<RexNode> exprs = new ArrayList<>();
Review comment:
Can we use stream?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services