Skip to content

Introduce Signature::String and return error if input of strpos is integer#12751

Merged
jayzhan211 merged 14 commits intoapache:mainfrom
jayzhan211:strpos-signaure
Oct 8, 2024
Merged

Introduce Signature::String and return error if input of strpos is integer#12751
jayzhan211 merged 14 commits intoapache:mainfrom
jayzhan211:strpos-signaure

Conversation

@jayzhan211
Copy link
Copy Markdown
Contributor

@jayzhan211 jayzhan211 commented Oct 4, 2024

Which issue does this PR close?

Rationale for this change

I think #12712 introduce a regression on integer type, this PR introduce another signature for string, and return error for integer input on strpos function, which has the same result as Postgres

postgres=# select position(1 in 1);
ERROR:  function pg_catalog.position(integer, integer) does not exist
LINE 1: select position(1 in 1);
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Others

Not sure is this generalize to all the string related function. Are they all expect converting null to String? Handle dictionary?

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate functions Changes to functions implementation logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants