Skip to content

Commit e506313

Browse files
committed
revise simple select, require FROM
1 parent 71f9e7c commit e506313

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

src/parser/parser.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -493,21 +493,21 @@ class QuestDBParser extends CstParser {
493493
this.OPTION1(() => {
494494
this.CONSUME(From);
495495
this.SUBRULE(this.fromClause);
496+
this.OPTION2(() => this.SUBRULE(this.whereClause));
497+
this.OPTION3(() => this.SUBRULE(this.sampleByClause));
498+
this.OPTION4(() => this.SUBRULE(this.latestOnClause));
499+
this.OPTION5(() => this.SUBRULE(this.groupByClause));
500+
// PIVOT clause: SELECT * FROM t PIVOT (agg FOR col IN (...))
501+
this.OPTION9(() => {
502+
this.CONSUME(Pivot);
503+
this.CONSUME(LParen);
504+
this.SUBRULE(this.pivotBody);
505+
this.CONSUME(RParen);
506+
});
507+
this.OPTION6(() => this.SUBRULE(this.orderByClause));
508+
this.OPTION8(() => this.SUBRULE(this.windowDefinitionClause));
509+
this.OPTION7(() => this.SUBRULE(this.limitClause));
496510
});
497-
this.OPTION2(() => this.SUBRULE(this.whereClause));
498-
this.OPTION3(() => this.SUBRULE(this.sampleByClause));
499-
this.OPTION4(() => this.SUBRULE(this.latestOnClause));
500-
this.OPTION5(() => this.SUBRULE(this.groupByClause));
501-
// PIVOT clause: SELECT * FROM t PIVOT (agg FOR col IN (...))
502-
this.OPTION9(() => {
503-
this.CONSUME(Pivot);
504-
this.CONSUME(LParen);
505-
this.SUBRULE(this.pivotBody);
506-
this.CONSUME(RParen);
507-
});
508-
this.OPTION6(() => this.SUBRULE(this.orderByClause));
509-
this.OPTION8(() => this.SUBRULE(this.windowDefinitionClause));
510-
this.OPTION7(() => this.SUBRULE(this.limitClause));
511511
});
512512

513513
private setOperation = this.RULE("setOperation", () => {

0 commit comments

Comments
 (0)