Support multiple SET variables (#1252)

This commit is contained in:
Ifeanyi Ubah 2024-05-07 18:51:39 +02:00 committed by GitHub
parent c4f3ef9600
commit eb36bd7138
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 145 additions and 33 deletions

View file

@ -17,8 +17,8 @@
use sqlparser::ast::{
CreateFunctionBody, CreateFunctionUsing, Expr, Function, FunctionArgumentList,
FunctionArguments, FunctionDefinition, Ident, ObjectName, SelectItem, Statement, TableFactor,
UnaryOperator,
FunctionArguments, FunctionDefinition, Ident, ObjectName, OneOrManyWithParens, SelectItem,
Statement, TableFactor, UnaryOperator,
};
use sqlparser::dialect::{GenericDialect, HiveDialect, MsSqlDialect};
use sqlparser::parser::{ParserError, ParserOptions};
@ -268,12 +268,12 @@ fn set_statement_with_minus() {
Statement::SetVariable {
local: false,
hivevar: false,
variable: ObjectName(vec![
variables: OneOrManyWithParens::One(ObjectName(vec![
Ident::new("hive"),
Ident::new("tez"),
Ident::new("java"),
Ident::new("opts")
]),
])),
value: vec![Expr::UnaryOp {
op: UnaryOperator::Minus,
expr: Box::new(Expr::Identifier(Ident::new("Xmx4g")))