File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -4726,7 +4726,7 @@ impl<'a> Parser<'a> {
47264726 ) ?,
47274727 } ,
47284728 // Case when Snowflake Semi-structured data like key:value
4729- Keyword :: NoKeyword | Keyword :: LOCATION | Keyword :: TYPE if dialect_of ! ( self is SnowflakeDialect | GenericDialect ) => {
4729+ Keyword :: NoKeyword | Keyword :: LOCATION | Keyword :: TYPE | Keyword :: DATE if dialect_of ! ( self is SnowflakeDialect | GenericDialect ) => {
47304730 Ok ( Value :: UnQuotedString ( w. value ) )
47314731 }
47324732 _ => self . expected (
Original file line number Diff line number Diff line change @@ -208,6 +208,17 @@ fn parse_json_using_colon() {
208208 select. projection[ 0 ]
209209 ) ;
210210
211+ let sql = "SELECT a:date FROM t" ;
212+ let select = snowflake ( ) . verified_only_select ( sql) ;
213+ assert_eq ! (
214+ SelectItem :: UnnamedExpr ( Expr :: JsonAccess {
215+ left: Box :: new( Expr :: Identifier ( Ident :: new( "a" ) ) ) ,
216+ operator: JsonOperator :: Colon ,
217+ right: Box :: new( Expr :: Value ( Value :: UnQuotedString ( "date" . to_string( ) ) ) ) ,
218+ } ) ,
219+ select. projection[ 0 ]
220+ ) ;
221+
211222 snowflake ( ) . one_statement_parses_to ( "SELECT a:b::int FROM t" , "SELECT CAST(a:b AS INT) FROM t" ) ;
212223}
213224
You can’t perform that action at this time.
0 commit comments