Skip to content

Based on PR #999: Add SQL support for multiple DataFrames#1150

Open
matreyes wants to merge 4 commits intoelixir-explorer:mainfrom
matreyes:main
Open

Based on PR #999: Add SQL support for multiple DataFrames#1150
matreyes wants to merge 4 commits intoelixir-explorer:mainfrom
matreyes:main

Conversation

@matreyes
Copy link
Copy Markdown

Hi team!

I have an use case for SQL API, so wondered if you are interested in reevaluate the PR #999, but with the API proposed by @josevalim that allows executing SQL queries across multiple DataFrames using a map.

  • sql/2 function accepts a map of table names to DataFrames
  • Supports JOINs, LEFT JOINs, aggregations, and other SQL operations
  • added multiple tests

Implements simplified SQL API proposed by Jose Valim that allows
executing SQL queries across multiple DataFrames using a map.

Features:
- New sql/2 function accepts a map of table names to DataFrames
- Backward compatible with existing sql/2 and sql/3 for single DataFrame
- Uses Polars SQLContext internally for query execution
- Supports JOINs, LEFT JOINs, aggregations, and other SQL operations
- Comprehensive test suite with 20 tests

Based on PR elixir-explorer#999 but simplified per Jose Valim's suggestion for a cleaner API.
Remove backward-compatible sql/2 and sql/3 for single DataFrame.
Now sql/2 consistently accepts a map of table names to DataFrames,
making the API simpler and more consistent.
- Add callback to Explorer.Backend.DataFrame behaviour
- Implement in Explorer.PolarsBackend.DataFrame and LazyFrame
- Remove callback from Explorer.Backend
- Update sql/2 to pick backend from first DataFrame or use default for empty tables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant