Skip to content

Conversation

@vincev
Copy link
Contributor

@vincev vincev commented Aug 16, 2023

Which issue does this PR close?

Closes #7299.

Rationale for this change

When unnesting a list array created by array_agg aggregation fails with error:

ArrowError(ComputeError("concat requires input of at least one array"))

This PR adds code to prevent concat from being called with an empty array during unnesting.

What changes are included in this PR?

This PR adds code to prevent concat from being called with an empty array during unnesting.

This PR also removes the list_lengths workaround fixed in arrow #4517.

Are these changes tested?

Yes added a test for the failing scenario.

Are there any user-facing changes?

No

@github-actions github-actions bot added the core Core DataFusion crate label Aug 16, 2023
@vincev vincev marked this pull request as ready for review August 16, 2023 13:11
Copy link
Contributor

@izveigor izveigor left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you, @vincev!

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @vincev and @izveigor 🙏

}

#[tokio::test]
async fn unnest_array_agg() -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I verified that this test covers the code in this PR by running it without the code changes locally. It fails as expected 💯


---- dataframe::unnest_array_agg stdout ----
Error: ArrowError(ComputeError("concat requires input of at least one array"))

@alamb alamb merged commit 6b55adf into apache:main Aug 16, 2023
@vincev
Copy link
Contributor Author

vincev commented Aug 16, 2023

thank you @alamb, @izveigor for your review.

@vincev vincev deleted the arrayagg branch August 16, 2023 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unnest on aggregate list array fails with concat error.

3 participants