Skip to content

Commit dffd083

Browse files
authored
fixed parser error when parsing order by with nulls order clause (#12)
* fixed parser error when parsing order by with nulls order clause * pr remarks
1 parent 9224f83 commit dffd083

4 files changed

Lines changed: 23943 additions & 22129 deletions

File tree

grammars/SQLSelectParser.g4

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ olapOption:
188188
;
189189

190190
orderClause:
191-
ORDER_SYMBOL BY_SYMBOL orderList
191+
ORDER_SYMBOL BY_SYMBOL orderList nullsOrder?
192192
;
193193

194194
direction:
@@ -822,6 +822,10 @@ orderList:
822822
orderExpression (COMMA_SYMBOL orderExpression)*
823823
;
824824

825+
nullsOrder:
826+
NULLS_SYMBOL (FIRST_SYMBOL | LAST_SYMBOL)
827+
;
828+
825829
orderExpression:
826830
expr direction?
827831
;

parser/SQLSelectParser.interp

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)