File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ pub struct Select {
341
341
/// DISTRIBUTE BY (Hive)
342
342
pub distribute_by : Vec < Expr > ,
343
343
/// SORT BY (Hive)
344
- pub sort_by : Vec < Expr > ,
344
+ pub sort_by : Vec < OrderByExpr > ,
345
345
/// HAVING
346
346
pub having : Option < Expr > ,
347
347
/// WINDOW AS
Original file line number Diff line number Diff line change @@ -11591,7 +11591,7 @@ impl<'a> Parser<'a> {
11591
11591
};
11592
11592
11593
11593
let sort_by = if self.parse_keywords(&[Keyword::SORT, Keyword::BY]) {
11594
- self.parse_comma_separated(Parser::parse_expr )?
11594
+ self.parse_comma_separated(Parser::parse_order_by_expr )?
11595
11595
} else {
11596
11596
vec![]
11597
11597
};
Original file line number Diff line number Diff line change @@ -341,6 +341,9 @@ fn lateral_view() {
341
341
fn sort_by ( ) {
342
342
let sort_by = "SELECT * FROM db.table SORT BY a" ;
343
343
hive ( ) . verified_stmt ( sort_by) ;
344
+
345
+ let sort_by_with_direction = "SELECT * FROM db.table SORT BY a, b DESC" ;
346
+ hive ( ) . verified_stmt ( sort_by_with_direction) ;
344
347
}
345
348
346
349
#[ test]
You can’t perform that action at this time.
0 commit comments