Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coercion of input types in coalesce leads to type unsupported arrow cast #14581

Open
davidhewitt opened this issue Feb 10, 2025 · 3 comments · May be fixed by #14602
Open

coercion of input types in coalesce leads to type unsupported arrow cast #14581

davidhewitt opened this issue Feb 10, 2025 · 3 comments · May be fixed by #14602
Labels
bug Something isn't working

Comments

@davidhewitt
Copy link

Describe the bug

Tested on datafusion main at 5239d1a.

It looks like coercion of input types in coalesce (and probably other similar expressions) it's possible to end up with a common type of Dictionary(..., Utf8View), but arrow does not support casting to that type.

To Reproduce

select coalesce(arrow_cast('', 'Utf8View'), arrow_cast('', 'Dictionary(UInt32, Utf8)'));

leads to

Arrow error: Cast error: Unsupported output type for dictionary packing: Utf8View

Expected behavior

I would expect either:

  • datafusion's coercion rules to not select a type which is not supported to go inside a dictionary (Utf8View), OR
  • dictionary packing a Utf8View should be supported

Additional context

No response

@davidhewitt davidhewitt added the bug Something isn't working label Feb 10, 2025
@davidhewitt
Copy link
Author

I have a workaround in pydantic@ba9fa86, which might be the basis for a fix within datafusion if dict-packing string views is seen as unnecessary?

@alamb
Copy link
Contributor

alamb commented Feb 10, 2025

I believe @jayzhan211 is working on coercion

@tustvold
Copy link
Contributor

dict-packing string views is seen as unnecessar

I agree that a dictionary of a view type is a somewhat redundant construction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants