Blizzara opened a new pull request, #16205: URL: https://github.com/apache/datafusion/pull/16205
## Which issue does this PR close? - Closes #. ## Rationale for this change The bump to Arrow 55.1 brings with it https://github.com/apache/arrow-rs/pull/7247. That causes runtime errors using `ScalarStructBuilder` if the struct is empty. ## What changes are included in this PR? Use `try_new_with_length` instead of `try_new` to allow empty struct. Our length is always 1 as we're building a scalar. The `try_new_with_length` also does validation on the provided length against the arrays, so we can remove our validation. ## Are these changes tested? Existing tests for non-empty structs + a new unit test for empty struct. ## Are there any user-facing changes? The error thrown for a wrong-sized array is now different, as it comes from Arrow instead of being a DF InternalError. The Arrow error has some benefits, e.g. it mentions the field name, and also some downsides (I think Arrow doesn't include backtraces, tho I might be wrong): ``` Err(ArrowError::InvalidArgumentError(format!( "Incorrect array length for StructArray field {:?}, expected {} got {}", f.name(), len, a.len() ))) ``` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org