Split QueryExecutor::query
into separate methods for SQL and InfluxQL
#25831
Labels
QueryExecutor::query
into separate methods for SQL and InfluxQL
#25831
Problem statement
As part of #25751, when executing InfluxQL queries for the
/query
API, we need the ability to capture information about the incoming InfluxQL query and use that to augment how the HTTP API response is structured.The only case for this that I am currently aware of is when using a
GROUP BY
clause.Proposed solution
Split the
QueryExecutor::query
method into two methods:QueryExecutor::query_sql
andQueryExecutor::query_influxql
.The
query_sql
method will keep the current API, less thequery_kind
parameter, and can function as is.The
query_influxql
method will change in the following way:Statement
(it may also accept the raw query string if that is needed for query logging or otherwise)InfluxQLQueryPlanner::statement_to_plan
method to create the logical planOtherwise, its API will still stay the same such that it functions as is with the
/api/v3/query_influxql
APIThis will allow us to parse the InfluxQL query in the API handler, which we are already doing (see here), capture some state about the query, e.g., the
GROUP BY
clause, and use that to handle the record batch stream on its way out of the query execution. It also keeps us from parsing the query string twice (see here).Alternatives considered
N/A
Additional context
See related issue: #25751
The text was updated successfully, but these errors were encountered: