Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the position/order of LIMIT in GET/FIND #390

Merged
merged 2 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/kestrel/syntax/kestrel.lark
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ assignment: VARIABLE "=" expression
// All commands
//

find: "FIND"i ENTITY_TYPE RELATION (REVERSED)? VARIABLE where_clause? limit_clause? timespan?
find: "FIND"i ENTITY_TYPE RELATION (REVERSED)? VARIABLE where_clause? timespan? limit_clause?

get: "GET"i ENTITY_TYPE ("FROM"i datasource)? where_clause limit_clause? timespan?
get: "GET"i ENTITY_TYPE ("FROM"i datasource)? where_clause timespan? limit_clause?

group: "GROUP"i VARIABLE BY grp_spec ("WITH"i agg_list)?

Expand Down
8 changes: 4 additions & 4 deletions tests/test_command_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ def test_get_single_stixshifter_stix_bundle_limit(set_no_prefetch_kestrel_config
var = GET process
FROM HOST2
WHERE [ipv4-addr:value = '127.0.0.1']
LIMIT 4
START 2019-01-01T00:00:00Z STOP 2023-01-01T00:00:00Z
LIMIT 4
"""

s.execute(stmt)
Expand Down Expand Up @@ -264,8 +264,8 @@ def test_get_multiple_stixshifter_stix_bundles_limit(set_no_prefetch_kestrel_con
var = GET process
FROM HOST1,HOST2
WHERE ipv4-addr:value = '127.0.0.1'
LIMIT 10
START 2019-01-01T00:00:00Z STOP 2023-01-01T00:00:00Z
LIMIT 10
"""

s.execute(stmt)
Expand Down Expand Up @@ -303,8 +303,8 @@ def test_get_multiple_stixshifter_stix_bundles_limit_1(set_no_prefetch_kestrel_c
var = GET process
FROM HOST1,HOST2
WHERE ipv4-addr:value = '127.0.0.1'
LIMIT 15
START 2019-01-01T00:00:00Z STOP 2023-01-01T00:00:00Z
LIMIT 15
"""

s.execute(stmt)
Expand Down Expand Up @@ -342,8 +342,8 @@ def test_get_multiple_stixshifter_stix_bundles_limit_2(set_no_prefetch_kestrel_c
var = GET process
FROM HOST1,HOST2
WHERE ipv4-addr:value = '127.0.0.1'
LIMIT 50
START 2019-01-01T00:00:00Z STOP 2023-01-01T00:00:00Z
LIMIT 50
"""

s.execute(stmt)
Expand Down