Skip to content

Commit f57af7f

Browse files
committed
fixup! add failing tests
1 parent 223d1dd commit f57af7f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/sqlparser_databricks.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,4 +405,27 @@ fn parse_semi_structured_data_traversal() {
405405
}),
406406
select.projection[0]
407407
);
408+
409+
// asterisk for arrays
410+
let sql = "SELECT a:b[*].c FROM t";
411+
let select = databricks().verified_only_select(sql);
412+
assert_eq!(
413+
SelectItem::UnnamedExpr(Expr::JsonAccess {
414+
value: Box::new(Expr::Identifier(Ident::new("a"))),
415+
path: JsonPath {
416+
path: vec![
417+
JsonPathElem::Dot {
418+
key: "b".to_owned(),
419+
quoted: false
420+
},
421+
JsonPathElem::AllElements,
422+
JsonPathElem::Dot {
423+
key: "c".to_owned(),
424+
quoted: false
425+
}
426+
]
427+
},
428+
}),
429+
select.projection[0]
430+
);
408431
}

0 commit comments

Comments
 (0)