File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1302,7 +1302,24 @@ pub fn parse_create_stage(
13021302 // [ file_format]
13031303 if parser. parse_keyword ( Keyword :: FILE_FORMAT ) {
13041304 parser. expect_token ( & Token :: Eq ) ?;
1305- file_format = parser. parse_key_value_options ( true , & [ ] ) ?. options ;
1305+ if parser. peek_token ( ) . token == Token :: LParen {
1306+ file_format = parser. parse_key_value_options ( true , & [ ] ) ?. options ;
1307+ } else {
1308+ // Shorthand `FILE_FORMAT = '<name>'` / `FILE_FORMAT = <ident>` is
1309+ // sugar for `FILE_FORMAT = (FORMAT_NAME = <name>)` — normalize it.
1310+ let tok = parser. peek_token ( ) ;
1311+ let value = match tok. token {
1312+ Token :: Word ( w) => {
1313+ parser. next_token ( ) ;
1314+ Value :: Placeholder ( w. value . clone ( ) ) . with_span ( tok. span )
1315+ }
1316+ _ => parser. parse_value ( ) ?,
1317+ } ;
1318+ file_format = vec ! [ KeyValueOption {
1319+ option_name: "FORMAT_NAME" . to_string( ) ,
1320+ option_value: KeyValueOptionKind :: Single ( value) ,
1321+ } ] ;
1322+ }
13061323 }
13071324
13081325 // [ copy_options ]
You can’t perform that action at this time.
0 commit comments