morrySnow commented on code in PR #14851:
URL: https://github.com/apache/doris/pull/14851#discussion_r1042076243
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -299,7 +300,7 @@ public LogicalPlan
visitRegularQuerySpecification(RegularQuerySpecificationConte
SelectClauseContext selectCtx = ctx.selectClause();
LogicalPlan selectPlan;
if (ctx.fromClause() == null) {
- selectPlan = withOneRowRelation(selectCtx);
+ selectPlan =
withOneRowRelation(selectCtx.selectColumnClause());
Review Comment:
except could not work on one row relation, forbid it
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -1059,15 +1064,20 @@ private LogicalPlan withSelectHint(LogicalPlan
logicalPlan, SelectHintContext hi
return new LogicalSelectHint<>(hints, logicalPlan);
}
- private LogicalPlan withProjection(LogicalPlan input, SelectClauseContext
selectCtx,
+ private LogicalPlan withProjection(LogicalPlan input,
SelectColumnClauseContext selectCtx,
Optional<AggClauseContext> aggCtx) {
return ParserUtils.withOrigin(selectCtx, () -> {
// TODO: skip if havingClause exists
if (aggCtx.isPresent()) {
return input;
} else {
- List<NamedExpression> projects =
getNamedExpressions(selectCtx.namedExpressionSeq());
- return new LogicalProject<>(projects, input);
+ if (selectCtx.namedExpressionSeq() != null) {
+ List<NamedExpression> projects =
getNamedExpressions(selectCtx.namedExpressionSeq());
+ return new LogicalProject<>(projects,
Collections.emptyList(), input);
+ } else {
+ return new LogicalProject<>(ImmutableList.of(new
UnboundStar(Collections.emptyList())),
+
getNamedExpressions(selectCtx.namedExpressionSeq()), input);
+ }
Review Comment:
```java
if (selectCtx.EXCEPT() != null) {
// except ...
} else {
// normal
}
```
--
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]