-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: allow Binary type coercion in split_part function
#19819
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
base: main
Are you sure you want to change the base?
Conversation
|
The fix is prepared, I am not sure if this would be a reasonable change tbh tho. Maybe just setting config is fine? |
|
Personally I'm not sure about this approach as it might suggest all other string functions with similar signature should now be fixed to also ensure they coerce from binary 🤔 e.g. datafusion/datafusion/functions/src/string/ascii.rs Lines 63 to 74 in 0808f3a
datafusion/datafusion/functions/src/string/btrim.rs Lines 80 to 98 in 0808f3a
datafusion/datafusion/functions/src/string/contains.rs Lines 59 to 71 in 0808f3a
|
|
I guess ClickHouse does coerce them? So is this just a case of our semantics != ClickHouse? |
It's a similar problem to how Spark will coerce strings to ints for their math functions but we don't.
|
|
replace.rs uses Same for:
and maybe more. |
The problem is only with the ClickHouse https://datafusion.apache.org/user-guide/configs.html
So TLDR I don't think we need to make Instead I propose:
|
|
Thank you for working on this @lemorage Did you find out what was causing the internal error? I would expect the query would error with a normal error (about not supporting binary columns) |
Which issue does this PR close?
Rationale for this change
The
split_partfunction rejectedBinary/BinaryViewtypes, causing queries with bytea columns to fail with: "Expected String but received Binary, DataType: Binary".What changes are included in this PR?
Changed split_part signature from
Coercion::new_exact()toCoercion::new_implicit()for both string parameters.Are these changes tested?
Yes:
Are there any user-facing changes?