The KQL docs mention that this is a valid expression:
StormEvents
| where State in (
StormEvents
| summarize count() by State
| top 5 by count_
)
| count
https://learn.microsoft.com/en-us/kusto/query/in-cs-operator?view=azure-data-explorer#tabular-expression
The KQL ANTLR grammar in the repo fails to parse it:
line 5:4 mismatched input '|' expecting {')', ','}
line 7:4 mismatched input ')' expecting {<EOF>, ';'}
This seems to be due to this line in Kql.g4:
listEqualityExpression:
Left=relationalExpression OperatorToken=(IN | NOT_IN | IN_CI | NOT_IN_CI | HAS_ANY | HAS_ALL) '(' Expressions+=invocationExpression (',' Expressions+=invocationExpression)* ')';
which may need to be replaced with something like this (extra pipeExpression):
listEqualityExpression:
Left=relationalExpression OperatorToken=(IN | NOT_IN | IN_CI | NOT_IN_CI | HAS_ANY | HAS_ALL) '(' Subquery=pipeExpression ')'
| Left=relationalExpression OperatorToken=(IN | NOT_IN | IN_CI | NOT_IN_CI | HAS_ANY | HAS_ALL) '(' Expressions+=invocationExpression (',' Expressions+=invocationExpression)* ')'
;
Full repro:
The KQL docs mention that this is a valid expression:
https://learn.microsoft.com/en-us/kusto/query/in-cs-operator?view=azure-data-explorer#tabular-expression
The KQL ANTLR grammar in the repo fails to parse it:
This seems to be due to this line in Kql.g4:
which may need to be replaced with something like this (extra
pipeExpression):Full repro:
pip install antlr4-python3-runtime==4.13.2java -jar antlr4-4.13.2-complete.jar -Dlanguage=Python3 -visitor -o out Kql.g4