Skip to content

Commit

Permalink
SELECT: Update EBNF for partitioning (#18464)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiancai authored Aug 28, 2024
1 parent ec230d7 commit e28327b
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions sql-statements/sql-statement-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,27 @@ SelectStmtOpts ::=
SelectStmtStraightJoin
TableRefsClause ::=
TableRef AsOfClause? ( ',' TableRef AsOfClause? )*
TableRef ( ',' TableRef )*
TableRef ::=
TableFactor
| JoinTable
TableFactor ::=
TableName ( "PARTITION" "(" Identifier ("," Identifier)* ")" )? ("AS" TableAlias)? AsOfClause? TableSample?
JoinTable ::=
TableRef
(
("INNER" | "CROSS")? "JOIN" TableRef JoinClause?
| "STRAIGHT_JOIN" TableRef "ON" Expression
| ("LEFT" | "RIGHT") "OUTER"? "JOIN" TableRef JoinClause
| "NATURAL" ("LEFT" | "RIGHT") "OUTER"? "JOIN" TableFactor
)
JoinClause ::=
("ON" Expression
| "USING" "(" ColumnNameList ")" )
AsOfClause ::=
'AS' 'OF' 'TIMESTAMP' Expression
Expand All @@ -47,10 +67,19 @@ SelectLockOpt ::=
TableList ::=
TableName ( ',' TableName )*
WhereClause ::=
"WHERE" Expression
GroupByClause ::=
"GROUP" "BY" Expression
OrderBy ::=
"ORDER" "BY" Expression
WindowClause ::=
"WINDOW" WindowDefinition ("," WindowDefinition)*
TableSampleOpt ::=
TableSample ::=
'TABLESAMPLE' 'REGIONS' '(' ')'
```

Expand Down

0 comments on commit e28327b

Please sign in to comment.