-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Improve error message when string functions receive Binary types #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) |
This is related to |
9d88bfb to
62d712e
Compare
split_part function|
Thanks folks! Have updated the PR to improve the error msg better instead. |
Which issue does this PR close?
What changes are included in this PR?
Change internal error to user-facing error when function type coercion fails. Add helpful hint when Binary types are used with string functions.
Before:
After: