-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
STRPOS
doesn't support (Dictionary(Int32, Utf8)
as input type
#12670
Comments
This is a good example of the kind of bug that @findepi 's proposal will hopefully help with: Specifically once we get a standardized way to make specialized function bodies maybe this bug would be fixed by switching to that standardized way |
@goldmedal can you please check the following queries? orignal query from this isuse
a query without
|
It seems true that datafusion/datafusion/functions/src/unicode/strpos.rs Lines 83 to 84 in 1b3608d
but i don't see this reflected in the EXPLAIN plan, so not sure how it works. BTW strpos use of function-driven coercion rules is non-orthodox and seems not exactly in line with generally recommended approach (see @alamb 's #12308 (comment)), which may lead to inconsistencies between this function and others. |
Oh, you're right. The scalar value works well. I actually found this bug in another case.
|
It seems to have something to do with NULL handling. Your last query runs fine on current
|
I am unsure why this function would need manual type coercion. I haven't tested but I would think that a signature such as :
should be enough? |
I agree that seems reasonable to me. Maybe the code just needs to be cleaned up |
Because we need to handle Nulls as well |
I feel like we need to teach the coercion logic that it can substitute So given a signature like Exact(vec![Utf8View, Utf8View]), I would expect the coercion logic to be able to handle inputs like the following (by casting (Null, Null)
(Null, Utf8View)
(Utf8View, Null)
(Utf8View, Utf8View) |
Filed #12698 to track trying to improve this |
it seems the source of the problem is the |
Describe the bug
While working on #12415, I found
STRPOS
can't accept a dictionary string as an argument.To Reproduce
The following SQL can reproduce this bug
Expected behavior
This SQL should work.
Additional context
Actually, it may be a bug in recent commits. I am really sure it worked until 26c8004 (#12619). After rebasing to the latest main branch, the test case added by #12618 is broken. The bug maybe caused by 524e56d..c21d025
The text was updated successfully, but these errors were encountered: