Skip to content

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

@alamb alamb merged commit 62fa860 into apache:main Nov 23, 2024
8 checks passed
@alamb
Copy link
Contributor

alamb commented Nov 23, 2024

Thanks @yoavcloud and @iffyio

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.

3 participants