fix: handle PromQL time binary aggregation#8398
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the PromQL planner in src/query/src/promql/planner.rs to handle derived PromQL plans that may contain non-Greptime scans without row-key metadata. It replaces the error propagation (?) with a conditional let Ok(table) check when retrieving a table from the source. Additionally, a new unit test aggregate_over_binary_time_function_expr has been added to verify aggregation behavior over binary time function expressions. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
eadc83d to
a560200
Compare
What changed
Why
Issue #8397 showed query_range returning 500 for aggregation over a binary expression involving time(). In v1.1.x, binary projections can retain __tsid for metric-engine optimization. The outer aggregate then inspects row-key metadata and may traverse the EmptyMetric dummy scan generated for time(), which is not backed by a Greptime table provider.
Validation
Fixes #8397