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
Expressions: Sql expressions with Duckdb #81666
Conversation
@kylebrandt added the changes we discussed ( and fixed the issue you noticed ). Can you check/review this again please? NOTE: you will need to have the duckdb cli installed now and in your path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great -- very nice compromise that lets us make progress without exploding the build size for everyone. Given the feature toggle and limited dependency issues, i think it is safe to merge and improve some of the ergonomics in follup PRs -- most important is error handling and explanations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can make it more interoperable by laying over dataplane in another pass:
- Add QueryType Dropdown (Table/TimeSeries/Numeric) in UI
- Introduce two SSE types that mirror dataplane types, TimeSeriesLong and NumericLong
- Use those types respectively when TimeSeries or Numeric or selected
- (At this point, the output should work with Record queries for example)
- Update SSE operators to be able to read the Long Types (could be shim grafana/dataplane/sdata should make this relatively easy)
duckdb temp storage of dataframes using parquet and querying from sql expressions --------- Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
What is this feature?
This is a subset of the Optimus Duck hackathon. Which won the bronze in the Dec 2023 Hackathon.
This adds a SQL type to Expressions allowing the execution of SQL referencing queries on the panel. This provides powerful transformations, chaining SQL (think SQL Notebooks), analytics and aggregate functions from DuckDB, and provides the ability to transform data in Alerting, something that isn't possible with front end Transformations but is highly sought after.
Why do we need this feature?
Who is this feature for?
Population by State (gdev CSV file example)
Summarized Population for 2020 using SQL Expression
Please check that:
Fixes https://github.com/orgs/grafana/projects/55/views/19?pane=issue&itemId=51638046