Skip to content

Add support for nested lists in substrait consumer#20953

Merged
gabotechs merged 4 commits intoapache:mainfrom
alexanderbianchi:bianchi/addnestedsubstraitsupport
Mar 19, 2026
Merged

Add support for nested lists in substrait consumer#20953
gabotechs merged 4 commits intoapache:mainfrom
alexanderbianchi:bianchi/addnestedsubstraitsupport

Conversation

@alexanderbianchi
Copy link
Copy Markdown
Contributor

@alexanderbianchi alexanderbianchi commented Mar 15, 2026

Rationale for this change

Adds support for nested array expressions to the substrait consumer. Defined in algebra.proto.

What changes are included in this PR?

Implements the previously unimplemented consume_nested for NestedType::List.

Are these changes tested?

Yes, unit tests match the testing pattern for substrait literals in consumer/expr/literal.rs. Snapshot test is added for make_array() path.

Are there any user-facing changes?

User's will now be able to send nested list expressions. This change is purely additive all previous consumable Substrait plans will continue to work.

@github-actions github-actions Bot added the substrait Changes to the substrait crate label Mar 15, 2026
@alexanderbianchi alexanderbianchi force-pushed the bianchi/addnestedsubstraitsupport branch 2 times, most recently from fea10ee to 4abf8f7 Compare March 15, 2026 16:25
Copy link
Copy Markdown
Contributor

@LiaCastaneda LiaCastaneda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
fyi @dd-david-levin since you were looking into this too in #20821

cc @gabotechs could you take a look at this one whenever you have time? I think it’s good to go

Comment thread datafusion/substrait/src/logical_plan/consumer/expr/nested.rs Outdated
Comment thread datafusion/substrait/src/logical_plan/consumer/expr/nested.rs Outdated
@alexanderbianchi alexanderbianchi force-pushed the bianchi/addnestedsubstraitsupport branch 2 times, most recently from e3d511d to d74bd37 Compare March 16, 2026 14:23
@alexanderbianchi alexanderbianchi force-pushed the bianchi/addnestedsubstraitsupport branch from d74bd37 to fc7b3e8 Compare March 16, 2026 14:23
@gabotechs gabotechs requested a review from vbarua March 16, 2026 16:29
Copy link
Copy Markdown
Contributor

@vbarua vbarua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @alexanderbianchi. Changes LGTM from the Substrait perspective.

NestedType::List(list) => {
if list.values.is_empty() {
return substrait_err!(
"Empty Nested lists are not supported; use Literal.empty_list instead"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea providing the alternative encoding needed in the error message.

Copy link
Copy Markdown
Contributor

@gabotechs gabotechs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks @alexanderbianchi for the PR and @vbarua and @LiaCastaneda for the reviews!

@gabotechs gabotechs added this pull request to the merge queue Mar 19, 2026
Merged via the queue into apache:main with commit 4010a55 Mar 19, 2026
30 checks passed
haohuaijin pushed a commit to haohuaijin/arrow-datafusion that referenced this pull request Mar 21, 2026
## Rationale for this change

Adds support for nested array expressions to the substrait consumer.
Defined in
[algebra.proto.](https://github.com/substrait-io/substrait/blob/main/proto/substrait/algebra.proto#L1162)

## What changes are included in this PR?

Implements the previously unimplemented `consume_nested` for
`NestedType::List`.

## Are these changes tested?

Yes, unit tests match the testing pattern for substrait literals in
`consumer/expr/literal.rs`. Snapshot test is added for `make_array()`
path.

## Are there any user-facing changes?

User's will now be able to send nested list expressions. This change is
purely additive all previous consumable Substrait plans will continue to
work.
LiaCastaneda pushed a commit to DataDog/datafusion that referenced this pull request Mar 21, 2026
Adds support for nested array expressions to the substrait consumer.
Defined in
[algebra.proto.](https://github.com/substrait-io/substrait/blob/main/proto/substrait/algebra.proto#L1162)

Implements the previously unimplemented `consume_nested` for
`NestedType::List`.

Yes, unit tests match the testing pattern for substrait literals in
`consumer/expr/literal.rs`. Snapshot test is added for `make_array()`
path.

User's will now be able to send nested list expressions. This change is
purely additive all previous consumable Substrait plans will continue to
work.

(cherry picked from commit 4010a55)
LiaCastaneda pushed a commit to DataDog/datafusion that referenced this pull request Mar 23, 2026
Adds support for nested array expressions to the substrait consumer.
Defined in
[algebra.proto.](https://github.com/substrait-io/substrait/blob/main/proto/substrait/algebra.proto#L1162)

Implements the previously unimplemented `consume_nested` for
`NestedType::List`.

Yes, unit tests match the testing pattern for substrait literals in
`consumer/expr/literal.rs`. Snapshot test is added for `make_array()`
path.

User's will now be able to send nested list expressions. This change is
purely additive all previous consumable Substrait plans will continue to
work.

(cherry picked from commit 4010a55)
LiaCastaneda added a commit to DataDog/datafusion that referenced this pull request Mar 23, 2026
* Add support for nested lists in substrait consumer (apache#20953)

Adds support for nested array expressions to the substrait consumer.
Defined in
[algebra.proto.](https://github.com/substrait-io/substrait/blob/main/proto/substrait/algebra.proto#L1162)

Implements the previously unimplemented `consume_nested` for
`NestedType::List`.

Yes, unit tests match the testing pattern for substrait literals in
`consumer/expr/literal.rs`. Snapshot test is added for `make_array()`
path.

User's will now be able to send nested list expressions. This change is
purely additive all previous consumable Substrait plans will continue to
work.

(cherry picked from commit 4010a55)

* bad merge -- Add missing import

* Format

---------

Co-authored-by: alexanderbianchi <75697973+alexanderbianchi@users.noreply.github.com>
de-bgunter pushed a commit to de-bgunter/datafusion that referenced this pull request Mar 24, 2026
## Rationale for this change

Adds support for nested array expressions to the substrait consumer.
Defined in
[algebra.proto.](https://github.com/substrait-io/substrait/blob/main/proto/substrait/algebra.proto#L1162)

## What changes are included in this PR?

Implements the previously unimplemented `consume_nested` for
`NestedType::List`.

## Are these changes tested?

Yes, unit tests match the testing pattern for substrait literals in
`consumer/expr/literal.rs`. Snapshot test is added for `make_array()`
path.

## Are there any user-facing changes?

User's will now be able to send nested list expressions. This change is
purely additive all previous consumable Substrait plans will continue to
work.
gabotechs pushed a commit to DataDog/datafusion that referenced this pull request Apr 16, 2026
## Rationale for this change

Adds support for nested array expressions to the substrait consumer.
Defined in
[algebra.proto.](https://github.com/substrait-io/substrait/blob/main/proto/substrait/algebra.proto#L1162)

## What changes are included in this PR?

Implements the previously unimplemented `consume_nested` for
`NestedType::List`.

## Are these changes tested?

Yes, unit tests match the testing pattern for substrait literals in
`consumer/expr/literal.rs`. Snapshot test is added for `make_array()`
path.

## Are there any user-facing changes?

User's will now be able to send nested list expressions. This change is
purely additive all previous consumable Substrait plans will continue to
work.

(cherry picked from commit 4010a55)
gabotechs pushed a commit to DataDog/datafusion that referenced this pull request Apr 16, 2026
## Rationale for this change

Adds support for nested array expressions to the substrait consumer.
Defined in
[algebra.proto.](https://github.com/substrait-io/substrait/blob/main/proto/substrait/algebra.proto#L1162)

## What changes are included in this PR?

Implements the previously unimplemented `consume_nested` for
`NestedType::List`.

## Are these changes tested?

Yes, unit tests match the testing pattern for substrait literals in
`consumer/expr/literal.rs`. Snapshot test is added for `make_array()`
path.

## Are there any user-facing changes?

User's will now be able to send nested list expressions. This change is
purely additive all previous consumable Substrait plans will continue to
work.

(cherry picked from commit 4010a55)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants