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

feat: Add implicit casting to TypeSignature::String #13404

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jonathanc-n
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

#13402 #13394 were running into some problems with implicit casting due to TypeSignature::String not dealing with implicit casting properly

What changes are included in this PR?

Added implicit casting to TypeSignature::String

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions bot added logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) functions labels Nov 14, 2024
@Omega359
Copy link
Contributor

Please remove the changes to regexp_match as that change adds in support for utf8view which breaks that function (see ci output). It's a much larger issue than those changes. See #11911 (comment) for some details.

@jonathanc-n
Copy link
Contributor Author

Will fix this tommorow.

@jonathanc-n jonathanc-n marked this pull request as draft November 14, 2024 03:33
@jonathanc-n jonathanc-n marked this pull request as ready for review November 14, 2024 19:08
NULL

query T
SELECT ltrim(12345, '1')
Copy link
Contributor

@jayzhan211 jayzhan211 Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DuckDB doesn't allow this query 🤔
Numeric string casting is quite confusing to me

D SELECT ltrim(12345, '1');
Binder Error: No function matches the given name and argument types 'ltrim(INTEGER_LITERAL, STRING_LITERAL)'. You might need to add explicit type casts.
	Candidate functions:
	ltrim(VARCHAR) -> VARCHAR
	ltrim(VARCHAR, VARCHAR) -> VARCHAR

LINE 1: SELECT ltrim(12345, '1');

Same with postgres

postgres=# SELECT ltrim(12345, '1');
ERROR:  function ltrim(integer, unknown) does not exist
LINE 1: SELECT ltrim(12345, '1');
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

@jayzhan211 jayzhan211 marked this pull request as draft November 19, 2024 06:02
@jayzhan211
Copy link
Contributor

Mark this as draft as it is not ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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