feat: Elastic DSL in asap-planner-rs#327
Conversation
… support semantically similar queries as of now.
…ilar to SQLSchema).
Code Review
|
…her be "@timestamp", "timestamp", or end with "_time", and the range predicate must be datetime like. - Fix issue where lookback duration was not using time range specified by parsed ES DSL query. - Fix issue where rollup labels were same as group by labels for agg config -> should be all non group by (non metric) labels.
…uming to reflect expected behavior.
|
Most of the nontrivial logic issues (e.g. rollup and lookback window) should be addressed. |
milindsrivastava1997
left a comment
There was a problem hiding this comment.
Issue 1 — src/output/mod.rs is orphaned
asap-planner-rs/src/output/mod.rs declares three submodules (generator, sql_generator, elastic_generator) but none of those files exist inside output/, and lib.rs never declares pub mod output;. The
compiler never touches this directory, so it doesn't break the build — but it looks like an abandoned mid-refactor stub. Either delete the file or complete the move before merging.
Issue 2 — Time range extraction uses .first() instead of matching the time field
let time_range = query_info
.predicates
.first()
.and_then(|p| range_query_to_time_range(p, 0));
If a Term predicate (e.g. a service/datacenter filter) appears before the range predicate in the query, this returns None and silently falls back to t_repeat as the lookback window. Should scan for the
predicate whose field matches query_info.time_field:
let time_range = query_info.predicates.iter()
.find(|p| matches!(p, Predicate::Range { field, .. } if field == &query_info.time_field))
.and_then(|p| range_query_to_time_range(p, 0));
…Reject queries that use filter group by (not supported right now).
(Elasticsearch index) in asap-planner.
No description provided.