diff --git a/hogql_parser/HogQLParser.cpp b/hogql_parser/HogQLParser.cpp index 3a4cc87f5cbd9..dbb5666a34474 100644 --- a/hogql_parser/HogQLParser.cpp +++ b/hogql_parser/HogQLParser.cpp @@ -10146,6 +10146,10 @@ tree::TerminalNode* HogQLParser::KeywordContext::ID() { return getToken(HogQLParser::ID, 0); } +tree::TerminalNode* HogQLParser::KeywordContext::IS() { + return getToken(HogQLParser::IS, 0); +} + tree::TerminalNode* HogQLParser::KeywordContext::IF() { return getToken(HogQLParser::IF, 0); } @@ -10166,10 +10170,6 @@ tree::TerminalNode* HogQLParser::KeywordContext::INTERVAL() { return getToken(HogQLParser::INTERVAL, 0); } -tree::TerminalNode* HogQLParser::KeywordContext::IS() { - return getToken(HogQLParser::IS, 0); -} - tree::TerminalNode* HogQLParser::KeywordContext::JOIN() { return getToken(HogQLParser::JOIN, 0); } diff --git a/hogql_parser/HogQLParser.h b/hogql_parser/HogQLParser.h index 9496b4e90c9ba..c4820bdb2618b 100644 --- a/hogql_parser/HogQLParser.h +++ b/hogql_parser/HogQLParser.h @@ -2127,12 +2127,12 @@ class HogQLParser : public antlr4::Parser { antlr4::tree::TerminalNode *GROUP(); antlr4::tree::TerminalNode *HAVING(); antlr4::tree::TerminalNode *ID(); + antlr4::tree::TerminalNode *IS(); antlr4::tree::TerminalNode *IF(); antlr4::tree::TerminalNode *ILIKE(); antlr4::tree::TerminalNode *IN(); antlr4::tree::TerminalNode *INNER(); antlr4::tree::TerminalNode *INTERVAL(); - antlr4::tree::TerminalNode *IS(); antlr4::tree::TerminalNode *JOIN(); antlr4::tree::TerminalNode *KEY(); antlr4::tree::TerminalNode *LAST(); diff --git a/hogql_parser/setup.py b/hogql_parser/setup.py index dbc19420be826..0c85ce6891172 100644 --- a/hogql_parser/setup.py +++ b/hogql_parser/setup.py @@ -32,7 +32,7 @@ setup( name="hogql_parser", - version="1.0.13", + version="1.0.14", url="https://github.com/PostHog/posthog/tree/master/hogql_parser", author="PostHog Inc.", author_email="hey@posthog.com", diff --git a/posthog/hogql/grammar/HogQLParser.g4 b/posthog/hogql/grammar/HogQLParser.g4 index a5fcee76d7d31..9afb0bba4c8e7 100644 --- a/posthog/hogql/grammar/HogQLParser.g4 +++ b/posthog/hogql/grammar/HogQLParser.g4 @@ -191,6 +191,7 @@ columnExpr | LBRACE (kvPairList)? RBRACE # ColumnExprDict // TODO: currently unsupported in C++ | columnIdentifier # ColumnExprIdentifier ; + columnArgList: columnArgExpr (COMMA columnArgExpr)*; columnArgExpr: columnLambdaExpr | columnExpr; columnLambdaExpr: @@ -258,11 +259,10 @@ interval: SECOND | MINUTE | HOUR | DAY | WEEK | MONTH | QUARTER | YEAR; keyword // except NULL_SQL, INF, NAN_SQL : ALL | AND | ANTI | ANY | ARRAY | AS | ASCENDING | ASOF | BETWEEN | BOTH | BY | CASE - | CAST | COHORT | COLLATE | CROSS | CUBE | CURRENT - | DATE | DESC | DESCENDING + | CAST | COHORT | COLLATE | CROSS | CUBE | CURRENT | DATE | DESC | DESCENDING | DISTINCT | ELSE | END | EXTRACT | FINAL | FIRST - | FOR | FOLLOWING | FROM | FULL | GROUP | HAVING | ID - | IF | ILIKE | IN | INNER | INTERVAL | IS | JOIN | KEY + | FOR | FOLLOWING | FROM | FULL | GROUP | HAVING | ID | IS + | IF | ILIKE | IN | INNER | INTERVAL | JOIN | KEY | LAST | LEADING | LEFT | LIKE | LIMIT | NOT | NULLS | OFFSET | ON | OR | ORDER | OUTER | OVER | PARTITION | PRECEDING | PREWHERE | RANGE | RETURN | RIGHT | ROLLUP | ROW diff --git a/posthog/hogql/grammar/HogQLParser.py b/posthog/hogql/grammar/HogQLParser.py index cf2b82f619d91..1b2060a67ee93 100644 --- a/posthog/hogql/grammar/HogQLParser.py +++ b/posthog/hogql/grammar/HogQLParser.py @@ -8486,6 +8486,9 @@ def HAVING(self): def ID(self): return self.getToken(HogQLParser.ID, 0) + def IS(self): + return self.getToken(HogQLParser.IS, 0) + def IF(self): return self.getToken(HogQLParser.IF, 0) @@ -8501,9 +8504,6 @@ def INNER(self): def INTERVAL(self): return self.getToken(HogQLParser.INTERVAL, 0) - def IS(self): - return self.getToken(HogQLParser.IS, 0) - def JOIN(self): return self.getToken(HogQLParser.JOIN, 0) diff --git a/requirements.in b/requirements.in index 2b7efd33c6ddb..f5d224b7892bf 100644 --- a/requirements.in +++ b/requirements.in @@ -93,5 +93,5 @@ phonenumberslite==8.13.6 openai==1.10.0 tiktoken==0.6.0 nh3==0.2.14 -hogql-parser==1.0.12 +hogql-parser==1.0.14 zxcvbn==4.4.28 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3ab55989b8abe..23234cd68e276 100644 --- a/requirements.txt +++ b/requirements.txt @@ -276,7 +276,7 @@ h11==0.13.0 # wsproto hexbytes==1.0.0 # via dlt -hogql-parser==1.0.12 +hogql-parser==1.0.14 # via -r requirements.in httpcore==1.0.2 # via httpx