Skip to content
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

Split QueryExecutor::query into separate methods for SQL and InfluxQL #25831

Open
hiltontj opened this issue Jan 14, 2025 · 0 comments · May be fixed by #25845
Open

Split QueryExecutor::query into separate methods for SQL and InfluxQL #25831

hiltontj opened this issue Jan 14, 2025 · 0 comments · May be fixed by #25845
Assignees
Labels

Comments

@hiltontj
Copy link
Contributor

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 and QueryExecutor::query_influxql.

The query_sql method will keep the current API, less the query_kind parameter, and can function as is.

The query_influxql method will change in the following way:

Otherwise, its API will still stay the same such that it functions as is with the /api/v3/query_influxql API

This 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

@hiltontj hiltontj added the v3 label Jan 14, 2025
@hiltontj hiltontj self-assigned this Jan 14, 2025
@hiltontj hiltontj linked a pull request Jan 16, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant