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

feat(sql): additional sql functions #7035

Merged
merged 3 commits into from
Feb 20, 2023

Conversation

universalmind303
Copy link
Collaborator

Description

Added a bunch more sql functions, and slightly refactored the existing function parsing to make it more extensible.

Notes.

I wasn't sure if there was a specific engine we are trying to mimic for the functions, or if we wanted to keep it consistent with the python methods.

For example, getting the length of a List column

engine method
Spark SQL size
postgres array_length
duckdb len | array_length | list_length
py-polars arr.lengths

@github-actions github-actions bot added the enhancement New feature or an improvement of an existing feature label Feb 20, 2023
@ritchie46
Copy link
Member

Thanks a lot @universalmind303 this is very valuable. I wanted to have full SQL front-end, but couldn't find the time. Adding all these functions is a great step in that direction.

With regard to SQL flavor. Can we mimic PostgreSQL?

We can expand later if it is needed.

@universalmind303
Copy link
Collaborator Author

With regard to SQL flavor. Can we mimic PostgreSQL?

sounds good, ill make a couple changes to more closely align with PostgreSQL

@universalmind303 universalmind303 marked this pull request as draft February 20, 2023 07:13
@universalmind303 universalmind303 marked this pull request as ready for review February 20, 2023 09:07
@ritchie46 ritchie46 merged commit e4497fa into pola-rs:master Feb 20, 2023
josemasar pushed a commit to josemasar/polars that referenced this pull request Feb 21, 2023
@alexander-beedie alexander-beedie added the A-sql Area: Polars SQL functionality label Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql Area: Polars SQL functionality enhancement New feature or an improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants