Preserve double colon casts (and simplify cast representations) (#1221)

This commit is contained in:
Joey Hain 2024-04-21 05:21:58 -07:00 committed by GitHub
parent 9db20e293f
commit d1f67bdc47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 79 additions and 88 deletions

View file

@ -168,6 +168,7 @@ fn parse_array() {
let select = snowflake().verified_only_select(sql);
assert_eq!(
&Expr::Cast {
kind: CastKind::Cast,
expr: Box::new(Expr::Identifier(Ident::new("a"))),
data_type: DataType::Array(ArrayElemTypeDef::None),
format: None,
@ -228,7 +229,7 @@ fn parse_json_using_colon() {
select.projection[0]
);
snowflake().one_statement_parses_to("SELECT a:b::int FROM t", "SELECT CAST(a:b AS INT) FROM t");
snowflake().verified_stmt("SELECT a:b::INT FROM t");
let sql = "SELECT a:start, a:end FROM t";
let select = snowflake().verified_only_select(sql);