File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -429,8 +429,8 @@ impl<'a> DFParser<'a> {
429
429
}
430
430
431
431
fn parse_has_file_compression_type ( & mut self ) -> bool {
432
- self . consume_token ( & Token :: make_keyword ( "COMPRESSION" ) )
433
- & self . consume_token ( & Token :: make_keyword ( " TYPE" ) )
432
+ self . parser
433
+ . parse_keywords ( & [ Keyword :: COMPRESSION , Keyword :: TYPE ] )
434
434
}
435
435
436
436
fn parse_csv_has_header ( & mut self ) -> bool {
@@ -719,13 +719,20 @@ mod tests {
719
719
let sql = "CREATE EXTERNAL TABLE t STORED AS CSV WITH HEADER LOCATION 'abc'" ;
720
720
expect_parse_error ( sql, "sql parser error: Expected LOCATION, found: WITH" ) ;
721
721
722
- // Error case: `partitioned` is an invalid syntax
722
+ // Error case: a single word `partitioned` is invalid
723
723
let sql = "CREATE EXTERNAL TABLE t STORED AS CSV PARTITIONED LOCATION 'abc'" ;
724
724
expect_parse_error (
725
725
sql,
726
726
"sql parser error: Expected LOCATION, found: PARTITIONED" ,
727
727
) ;
728
728
729
+ // Error case: a single word `compression` is invalid
730
+ let sql = "CREATE EXTERNAL TABLE t STORED AS CSV COMPRESSION LOCATION 'abc'" ;
731
+ expect_parse_error (
732
+ sql,
733
+ "sql parser error: Expected LOCATION, found: COMPRESSION" ,
734
+ ) ;
735
+
729
736
Ok ( ( ) )
730
737
}
731
738
}
You can’t perform that action at this time.
0 commit comments