Skip to content

Commit cca9fc7

Browse files
committed
Code review comments
1 parent 684d6fc commit cca9fc7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/ast/query.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,11 @@ pub struct TableAlias {
25332533
pub name: Ident,
25342534
/// Optional column aliases declared in parentheses after the table alias.
25352535
pub columns: Vec<TableAliasColumnDef>,
2536-
/// Optional PartiQL index alias declared with `AT`.
2536+
/// Optional PartiQL index alias declared with `AT`. For example:
2537+
/// ```sql
2538+
/// SELECT element, index FROM bar AS b, b.data.scalar_array AS element AT index
2539+
/// ```
2540+
/// See: <https://docs.aws.amazon.com/redshift/latest/dg/query-super.html>
25372541
pub at: Option<Ident>,
25382542
}
25392543

tests/sqlparser_redshift.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,12 @@ fn test_null_treatment_inside_and_outside_window_function() {
520520

521521
#[test]
522522
fn test_partiql_from_alias_with_at_index() {
523-
redshift().verified_stmt("SELECT * FROM lineitem AS l (a, b, c) AT idx");
523+
let dialects = all_dialects_where(|d| d.supports_partiql());
524+
dialects.verified_stmt("SELECT * FROM lineitem AS l (a, b, c) AT idx");
524525

525526
let sql =
526527
"SELECT index, val FROM (SELECT array('AAA', 'BBB') AS val) AS b, b.val AS val AT index";
527-
let select = redshift().verified_only_select(sql);
528+
let select = dialects.verified_only_select(sql);
528529

529530
match &select.from[1].relation {
530531
TableFactor::Table { name, alias, .. } => {

0 commit comments

Comments
 (0)