-
Notifications
You must be signed in to change notification settings - Fork 38
Implement CQL2-JSON AST for datetime index selection #560
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
base: main
Are you sure you want to change the base?
Conversation
da79693 to
ad39114
Compare
|
Hey, I ran one test with this query and body: And I got that index_param has this value. it looks like it's not selecting temporal indices. Please add tests for temporal indices. |
a8029b8 to
8862c38
Compare
- Added Abstract Syntax Tree (AST) representation for CQL2 queries replacing dictionary-based queries - Implemented datetime extraction logic to identify datetime, start_datetime, and end_datetime - Support for complex queries with logical operators, spatial operations, and property comparisons - Improved query parsing and maintainability of CQL2-JSON filter requests
- Added tests for CQL2-JSON datetime filter operators - Tested datetime field operators: =, <=, >=, AND combinations - Tested start_datetime and end_datetime field operators - Verified range queries work correctly with date fields - Ensured AST parsing correctly handles datetime comparisons
10a14c3 to
c18714f
Compare
@Gomez324 I have fixed selection of collection IDs from the CQL2-JSON query, only then are the indexes selected correctly, it needs to have as input variables I’ve also added a test for the |
|
I created a somewhat more complex filter: so sentinel-2-l2a from 2010-2025 and sentinel-2-l1c from 2012-2025. But when I debug, I see: (Pdb) datetime_search So the filter is being parsed incorrectly. it's merging the datetime ranges instead of keeping them separate per collection. |
This PR implements a CQL2 Abstract Syntax Tree (AST) structure for CQL2 Filters to enable better parameter access for index selection in search queries:
The AST-based approach makes it easier to parse CQL2 filters, particularly for identifying datetime constraints (datetime, start_datetime, end_datetime) to optimize search performance through proper index selection.
Examples of AST nodes:
AND:
OR:
NOT:
EQ (=):
NEQ (<>)
LT (<)
LTE (<=)
GT (>)
GTE (>=)
IS_NULL
LIKE
BETWEEN
IN
S_INTERSECTS
S_CONTAINS
S_WITHIN
S_DISJOINT
DateTimeRange
DateTimeExactNode
PR Checklist:
pre-commit run --all-files)make test)