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

PartiQL queries in Redshift #1534

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

PartiQL queries in Redshift #1534

wants to merge 4 commits into from

Conversation

yoavcloud
Copy link
Contributor

This PR adds support for parsing PartiQL queries in Redshift

#[test]
fn test_redshift_json_path() {
let sql = "SELECT cust.c_orders[0].o_orderkey FROM customer_orders_lineitem";
let select = redshift().verified_only_select(sql);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use let dialect = all_dialects_where(|d| d.supports_partiql()) for the tests? thinking so any dialect that gets this feature can potentially reuse the same tests

src/ast/query.rs Outdated
Comment on lines 977 to 978
/// Optional PartiQL JsonPath: <https://partiql.org/dql/from.html>
partiql: Option<JsonPath>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can call this json_path to be generic (in the doc we mention partiql as one example)?


#[test]
fn test_parse_json_path_from() {
let select = redshift().verified_only_select("SELECT * FROM src[0].a AS a");
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a test for something containing a qualified name e.g. a.b.c[0].d (it wasn't clear from the code how that's represented or rejected if its not valid partiql)?

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM! cc @alamb

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.

2 participants