Skip to content

Commit

Permalink
ZDM-606: Support OR operator. Add unit tests for various WHERE condit…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
lukasz-antoniak committed Jun 5, 2024
1 parent ab846d4 commit 3b19902
Show file tree
Hide file tree
Showing 10 changed files with 1,883 additions and 1,707 deletions.
8 changes: 7 additions & 1 deletion antlr/SimplifiedCql.g4
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ condition

// Note: custom index expressions not supported
whereClause
: K_WHERE relation ( K_AND relation )*
: K_WHERE relation ( logicalOperator relation )*
;

logicalOperator
: K_AND
| K_OR
;

relation
Expand Down Expand Up @@ -493,6 +498,7 @@ K_MAP: M A P;
K_NAN: N A N;
K_NOT: N O T;
K_NULL: N U L L;
K_OR: O R;
K_ORDER: O R D E R;
K_PARTITION: P A R T I T I O N;
K_PER: P E R;
Expand Down
5 changes: 4 additions & 1 deletion antlr/SimplifiedCql.interp

Large diffs are not rendered by default.

85 changes: 43 additions & 42 deletions antlr/SimplifiedCql.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -65,46 +65,47 @@ K_MAP=64
K_NAN=65
K_NOT=66
K_NULL=67
K_ORDER=68
K_PARTITION=69
K_PER=70
K_SELECT=71
K_SET=72
K_SMALLINT=73
K_TEXT=74
K_TIMESTAMP=75
K_TIMEUUID=76
K_TIME=77
K_TINYINT=78
K_TOKEN=79
K_TTL=80
K_TUPLE=81
K_TYPE=82
K_UNLOGGED=83
K_UPDATE=84
K_USE=85
K_USING=86
K_UUID=87
K_VALUES=88
K_VARCHAR=89
K_VARINT=90
K_WHERE=91
K_WRITETIME=92
STRING_LITERAL=93
QUOTED_IDENTIFIER=94
INTEGER=95
QMARK=96
FLOAT=97
BOOLEAN=98
DURATION=99
UNQUOTED_IDENTIFIER=100
HEXNUMBER=101
UUID=102
WS=103
COMMENT=104
MULTILINE_COMMENT=105
EOS=106
OTHER=107
K_OR=68
K_ORDER=69
K_PARTITION=70
K_PER=71
K_SELECT=72
K_SET=73
K_SMALLINT=74
K_TEXT=75
K_TIMESTAMP=76
K_TIMEUUID=77
K_TIME=78
K_TINYINT=79
K_TOKEN=80
K_TTL=81
K_TUPLE=82
K_TYPE=83
K_UNLOGGED=84
K_UPDATE=85
K_USE=86
K_USING=87
K_UUID=88
K_VALUES=89
K_VARCHAR=90
K_VARINT=91
K_WHERE=92
K_WRITETIME=93
STRING_LITERAL=94
QUOTED_IDENTIFIER=95
INTEGER=96
QMARK=97
FLOAT=98
BOOLEAN=99
DURATION=100
UNQUOTED_IDENTIFIER=101
HEXNUMBER=102
UUID=103
WS=104
COMMENT=105
MULTILINE_COMMENT=106
EOS=107
OTHER=108
'('=1
')'=2
','=3
Expand All @@ -125,5 +126,5 @@ OTHER=107
':'=18
'{'=19
'}'=20
'?'=96
';'=106
'?'=97
';'=107
5 changes: 4 additions & 1 deletion antlr/SimplifiedCqlLexer.interp

Large diffs are not rendered by default.

85 changes: 43 additions & 42 deletions antlr/SimplifiedCqlLexer.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -65,46 +65,47 @@ K_MAP=64
K_NAN=65
K_NOT=66
K_NULL=67
K_ORDER=68
K_PARTITION=69
K_PER=70
K_SELECT=71
K_SET=72
K_SMALLINT=73
K_TEXT=74
K_TIMESTAMP=75
K_TIMEUUID=76
K_TIME=77
K_TINYINT=78
K_TOKEN=79
K_TTL=80
K_TUPLE=81
K_TYPE=82
K_UNLOGGED=83
K_UPDATE=84
K_USE=85
K_USING=86
K_UUID=87
K_VALUES=88
K_VARCHAR=89
K_VARINT=90
K_WHERE=91
K_WRITETIME=92
STRING_LITERAL=93
QUOTED_IDENTIFIER=94
INTEGER=95
QMARK=96
FLOAT=97
BOOLEAN=98
DURATION=99
UNQUOTED_IDENTIFIER=100
HEXNUMBER=101
UUID=102
WS=103
COMMENT=104
MULTILINE_COMMENT=105
EOS=106
OTHER=107
K_OR=68
K_ORDER=69
K_PARTITION=70
K_PER=71
K_SELECT=72
K_SET=73
K_SMALLINT=74
K_TEXT=75
K_TIMESTAMP=76
K_TIMEUUID=77
K_TIME=78
K_TINYINT=79
K_TOKEN=80
K_TTL=81
K_TUPLE=82
K_TYPE=83
K_UNLOGGED=84
K_UPDATE=85
K_USE=86
K_USING=87
K_UUID=88
K_VALUES=89
K_VARCHAR=90
K_VARINT=91
K_WHERE=92
K_WRITETIME=93
STRING_LITERAL=94
QUOTED_IDENTIFIER=95
INTEGER=96
QMARK=97
FLOAT=98
BOOLEAN=99
DURATION=100
UNQUOTED_IDENTIFIER=101
HEXNUMBER=102
UUID=103
WS=104
COMMENT=105
MULTILINE_COMMENT=106
EOS=107
OTHER=108
'('=1
')'=2
','=3
Expand All @@ -125,5 +126,5 @@ OTHER=107
':'=18
'{'=19
'}'=20
'?'=96
';'=106
'?'=97
';'=107
6 changes: 6 additions & 0 deletions antlr/simplifiedcql_base_listener.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3b19902

Please sign in to comment.