mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-05 17:00:58 +00:00
* feat(promql): let TQL discover metrics on the native route TQL statements never prepared a metric discovery scope, so the native route declined nameless and regex `__name__` selectors in TQL (`metric_discovery_unavailable`) and the legacy planner then rejected them, while the same query worked over the Prometheus HTTP API. SQL statement authorization now prepares the scope for the PromQL a statement evaluates (TQL EVAL/EXPLAIN/ANALYZE and TQL CTEs), keeping each discovered table that the statement's own permission request may read, and resolves the statement's table targets from the named tables plus that scope, as the HTTP path does. The returned context is the one the statement is planned with. A TQL CTE that discovers metrics publishes the native answer's columns: the legacy planner refuses such selectors, so there is no legacy schema to publish over it. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test(frontend): pin TQL discovery to the statement's own permission request Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * refactor(query): plan a metric-discovering TQL relation natively once Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>