KARTIK64-rgb opened a new pull request, #20785:
URL: https://github.com/apache/datafusion/pull/20785
## Which issue does this PR close?
- Closes #20756.
## Rationale for this change
The substrait crate released version 0.62.3 which introduced two new
`RexType` enum variants, `Lambda` and `LambdaInvocation`, as a breaking change
from 0.62.2. Since DataFusion's workspace `Cargo.toml` specifies the substrait
dependency as `"0.62"`, Cargo resolves to 0.62.3 on a clean checkout, causing
`datafusion-substrait` to fail to compile entirely with the following error:
```
error[E0004]: non-exhaustive patterns: `&RexType::Lambda(_)` and
`&RexType::LambdaInvocation(_)` not covered
```
This means anyone building datafusion-substrait from a clean environment
today will hit a hard compile failure with no workaround.
## What changes are included in this PR?
Two new match arms have been added to the `from_substrait_rex` function in
`datafusion/substrait/src/logical_plan/consumer/expr/mod.rs` to handle the two
new variants introduced in substrait 0.62.3:
```rust
RexType::Lambda(_) => {
not_impl_err!("Lambda expressions are not yet supported")
}
RexType::LambdaInvocation(_) => {
not_impl_err!("LambdaInvocation expressions are not yet
supported")
}
},
```
Both arms return `not_impl_err!` with a descriptive message, which is
exactly the same pattern already used in this codebase for other unsupported
expression types such as `Nested`, `Enum`, `MultiOrList`, and
`DynamicParameter`. No existing behaviour was changed and no other files were
modified.
## Are these changes tested?
The fix restores compilation against substrait 0.62.3. No new unit tests are
added because `Lambda` and `LambdaInvocation` are not yet supported at a
functional level. The `not_impl_err!` return ensures that any Substrait plan
containing these variants will produce a clean and descriptive `DataFusion
error: This feature is not implemented` message at runtime, consistent with how
all other unsupported expression types in this codebase behave. The full
existing test suite was run locally with `cargo test -p datafusion-substrait`
and all existing tests continue to pass.
## Are there any user-facing changes?
Prior to this fix, `datafusion-substrait` would not compile at all when
Cargo resolved `substrait` to version 0.62.3. After this fix, the crate
compiles correctly against 0.62.3. Any Substrait plan containing a `Lambda` or
`LambdaInvocation` expression will return a clear not-implemented error at
runtime rather than a compile failure. There are no breaking API changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]