[opt](Nereids) throw exception when aliasedQuery has no alias(#15854)

This commit is contained in:
谢健
2023-01-13 00:35:16 +08:00
committed by GitHub
parent 14e3879c4b
commit 9d41994c17
2 changed files with 16 additions and 0 deletions

View File

@ -469,6 +469,9 @@ public class LogicalPlanBuilder extends DorisParserBaseVisitor<Object> {
@Override
public LogicalPlan visitAliasedQuery(AliasedQueryContext ctx) {
if (ctx.tableAlias().getText().equals("")) {
throw new ParseException("Every derived table must have its own alias", ctx);
}
LogicalPlan plan = withTableAlias(visitQuery(ctx.query()), ctx.tableAlias());
for (LateralViewContext lateralViewContext : ctx.lateralView()) {
plan = withGenerate(plan, lateralViewContext);