Add support for ORDER BY ALL (#1724)

This commit is contained in:
SiLe Zhou 2025-02-22 13:52:07 +08:00 committed by GitHub
parent 8fc8082e9a
commit 1f1c0693da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 396 additions and 129 deletions

View file

@ -23,8 +23,8 @@
use sqlparser::ast::{
ClusteredBy, CommentDef, CreateFunction, CreateFunctionBody, CreateFunctionUsing, CreateTable,
Expr, Function, FunctionArgumentList, FunctionArguments, Ident, ObjectName,
OneOrManyWithParens, OrderByExpr, SelectItem, Statement, TableFactor, UnaryOperator, Use,
Value,
OneOrManyWithParens, OrderByExpr, OrderByOptions, SelectItem, Statement, TableFactor,
UnaryOperator, Use, Value,
};
use sqlparser::dialect::{GenericDialect, HiveDialect, MsSqlDialect};
use sqlparser::parser::ParserError;
@ -171,14 +171,18 @@ fn create_table_with_clustered_by() {
sorted_by: Some(vec![
OrderByExpr {
expr: Expr::Identifier(Ident::new("a")),
asc: Some(true),
nulls_first: None,
options: OrderByOptions {
asc: Some(true),
nulls_first: None,
},
with_fill: None,
},
OrderByExpr {
expr: Expr::Identifier(Ident::new("b")),
asc: Some(false),
nulls_first: None,
options: OrderByOptions {
asc: Some(false),
nulls_first: None,
},
with_fill: None,
},
]),