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] struct subscript and json_query #2891

Merged

Conversation

universalmind303
Copy link
Contributor

@universalmind303 universalmind303 commented Sep 23, 2024

adds nested access for structs and maps, as well as json_query function

@github-actions github-actions bot added the enhancement New feature or request label Sep 23, 2024
Copy link

codspeed-hq bot commented Sep 23, 2024

CodSpeed Performance Report

Merging #2891 will not alter performance

Comparing universalmind303:json-and-subscript-sql (9d159bd) with main (b519944)

Summary

✅ 17 untouched benchmarks

Copy link
Contributor

@jaychia jaychia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good!

// TODO
fn register(parent: &mut SQLFunctions) {
parent.add_fn("map_get", MapGet);
parent.add_fn("map_extract", MapGet);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an alias to maintain ANSI/postgres compatibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, ANSI doesn't really have any standard for what you can/cant call your functions. I mostly added the alias because I've seen it in other db systems (such as duckdb).

Copy link
Member

@kevinzwang kevinzwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! just one small comment

Ok(daft_functions::list::slice(expr, lower, upper))
}
_ => {
unsupported_sql_err!("slice with only one bound not yet supported");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we do currently support it. If lower is not specified, it should be 0. If upper is not specified, we can pass in a null literal to daft_functions::list::slice and it will work properly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, just havent gotten around to implementing it yet. will follow up with support for it.

Co-authored-by: Jay Chia <17691182+jaychia@users.noreply.github.com>
@universalmind303 universalmind303 enabled auto-merge (squash) September 24, 2024 22:54
@universalmind303 universalmind303 merged commit 05eeffb into Eventual-Inc:main Sep 24, 2024
36 checks passed
@universalmind303 universalmind303 deleted the json-and-subscript-sql branch January 23, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants