Skip to content

Commit

Permalink
fix(hog): release new parser (#22913)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored Jun 12, 2024
1 parent 3c29351 commit f6f25f0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions hogql_parser/HogQLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion hogql_parser/HogQLParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion hogql_parser/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
Expand Down
8 changes: 4 additions & 4 deletions posthog/hogql/grammar/HogQLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ columnExpr
| LBRACE (kvPairList)? RBRACE # ColumnExprDict // TODO: currently unsupported in C++
| columnIdentifier # ColumnExprIdentifier
;

columnArgList: columnArgExpr (COMMA columnArgExpr)*;
columnArgExpr: columnLambdaExpr | columnExpr;
columnLambdaExpr:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions posthog/hogql/grammar/HogQLParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f6f25f0

Please sign in to comment.