Skip to content

Commit 700128c

Browse files
jmhainalamb
authored andcommitted
Consolidate representation of function calls, remove AggregateExpressionWithFilter, ArraySubquery, ListAgg and ArrayAgg (apache#1247)
Co-authored-by: Andrew Lamb <[email protected]>
1 parent 34bb424 commit 700128c

16 files changed

+773
-1040
lines changed

src/ast/mod.rs

+159-187
Large diffs are not rendered by default.

src/ast/visitor.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ where
515515
/// ```
516516
/// # use sqlparser::parser::Parser;
517517
/// # use sqlparser::dialect::GenericDialect;
518-
/// # use sqlparser::ast::{Expr, Function, FunctionArg, FunctionArgExpr, Ident, ObjectName, Value, visit_expressions_mut, visit_statements_mut};
518+
/// # use sqlparser::ast::*;
519519
/// # use core::ops::ControlFlow;
520520
/// let sql = "SELECT x, y FROM t";
521521
/// let mut statements = Parser::parse_sql(&GenericDialect{}, sql).unwrap();
@@ -525,9 +525,15 @@ where
525525
/// let old_expr = std::mem::replace(expr, Expr::Value(Value::Null));
526526
/// *expr = Expr::Function(Function {
527527
/// name: ObjectName(vec![Ident::new("f")]),
528-
/// args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(old_expr))],
528+
/// args: FunctionArguments::List(FunctionArgumentList {
529+
/// duplicate_treatment: None,
530+
/// args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(old_expr))],
531+
/// clauses: vec![],
532+
/// }),
529533
/// null_treatment: None,
530-
/// filter: None, over: None, distinct: false, special: false, order_by: vec![],
534+
/// filter: None,
535+
/// over: None,
536+
/// within_group: vec![],
531537
/// });
532538
/// }
533539
/// ControlFlow::<()>::Continue(())

src/keywords.rs

-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ define_keywords!(
8787
ARCHIVE,
8888
ARE,
8989
ARRAY,
90-
ARRAY_AGG,
9190
ARRAY_MAX_CARDINALITY,
9291
AS,
9392
ASC,
@@ -401,7 +400,6 @@ define_keywords!(
401400
LIKE_REGEX,
402401
LIMIT,
403402
LINES,
404-
LISTAGG,
405403
LN,
406404
LOAD,
407405
LOCAL,

0 commit comments

Comments
 (0)