Skip to content

Redshift: PartiQL AT <index>#2303

Merged
iffyio merged 3 commits intoapache:mainfrom
yoavcloud:redshift_partiql_at
Apr 20, 2026
Merged

Redshift: PartiQL AT <index>#2303
iffyio merged 3 commits intoapache:mainfrom
yoavcloud:redshift_partiql_at

Conversation

@yoavcloud
Copy link
Copy Markdown
Contributor

Add support for the AT keyword in PartiQL that is used during unnesting to retrieve the index of an element in an array.

For example:

SELECT index, val FROM my_table t, t.my_array val AT index;

Comment thread src/ast/query.rs Outdated
Comment on lines +2530 to +2531
/// Optional PartiQL index alias declared with `AT`.
pub at: Option<Ident>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add a link to the doc defining the syntax? (maybe an example syntax would also be helpful like we have on the explicit field)

Comment thread tests/sqlparser_redshift.rs Outdated

#[test]
fn test_partiql_from_alias_with_at_index() {
redshift().verified_stmt("SELECT * FROM lineitem AS l (a, b, c) AT idx");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for the test can we switch to all_dialect_where(|d| d.supports_partiql()) so that future dialects are covered without duplicating tests?

@yoavcloud yoavcloud force-pushed the redshift_partiql_at branch from fe58eb4 to cca9fc7 Compare April 20, 2026 09:24
@yoavcloud yoavcloud requested a review from iffyio April 20, 2026 09:25
Copy link
Copy Markdown
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! Thanks @yoavcloud!

@iffyio iffyio added this pull request to the merge queue Apr 20, 2026
Merged via the queue into apache:main with commit 63e9a33 Apr 20, 2026
10 checks passed
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