feat: Upgrade to sqlparser-rs 0.62.0#22069
Conversation
Bump from crates.io 0.61.0 to git main rev 9833c033bc44c... to gain access to SparkSqlDialect ahead of the next sqlparser-rs release. Notable upstream changes absorbed: - Lambda::params is now OneOrManyWithParens<LambdaFunctionParameter>; reject typed lambda parameters (not_impl_err) since DataFusion does not model parameter data types. - Insert::columns is now Vec<ObjectName>; reject multi-part column names in INSERT (not_impl_err). - ExcludeSelectItem::Single/Multiple now carry ObjectName; reject multi-part EXCLUDE identifiers (plan_err). - New SelectItem::ExprWithAliases, BeginTransactionKind::Tran, TableConstraint::PrimaryKeyUsingIndex/UniqueUsingIndex, TableObject::TableQuery variants -> not_impl_err. - WildcardAdditionalOptions gained opt_alias -> not_impl_err. - VALUES rows are now Vec<Parens<Vec<Expr>>>; iterate via .content. - CREATE FUNCTION return_type is now Option<FunctionReturnType> (DataType vs SetOf); reject SETOF. - escape_char in Like/ILike/SimilarTo is now Option<ValueWithSpan>. - TableAlias gained `at: Option<Ident>`; CreateTable, CreateView, Insert, Update, Delete, Select, TableFactor::Function gained several new fields with `not_impl_err!` for unsupported ones. Update higher_order.slt golden error messages to match new LambdaFunctionParameter Debug formatting.
| // Declared outside the `if let` so `idents.extend(exclude_owned.iter())` | ||
| // below can borrow references that outlive the inner scope. | ||
| #[cfg(feature = "sql")] | ||
| let exclude_owned: Vec<sqlparser::ast::Ident>; | ||
| if let Some(exclude) = opt_exclude { | ||
| #[cfg(feature = "sql")] |
There was a problem hiding this comment.
I'm not too sure about this feature gating, tbh.
This is what Claude suggested
There was a problem hiding this comment.
Claude says:
Here's what's happening and why the cfg(feature = "sql") gates exist:
The setup. datafusion-expr has a sql feature (on by default) that depends on sqlparser. When sql is enabled, ExcludeSelectItem is re-exported from sqlparser::ast. When it's disabled, expr.rs provides its
own fallback enum with Ident payloads (datafusion/expr/src/expr.rs:1431-1436). The two paths in utils.rs already exist via the existing #[cfg(...)] imports at lines 41-45.
What sqlparser 0.62 changed. In 0.61, ExcludeSelectItem::Single carried Ident and Multiple carried Vec. In 0.62, both now carry ObjectName (a possibly multi-part name like schema.column). The
fallback enum in expr.rs still uses Ident because that crate-local copy hasn't changed.
|
Thanks @andygrove I'll review the PR tomorrow |
Which issue does this PR close?
N/A
Rationale for this change
Dependency update
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?