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

substr function no longer coerces types previously accepted #13150

Closed
Omega359 opened this issue Oct 29, 2024 · 2 comments
Closed

substr function no longer coerces types previously accepted #13150

Omega359 opened this issue Oct 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Omega359
Copy link
Contributor

Describe the bug

In my test suite I have a test that includes the following:

substr(error_code, 3)

where error_code was an int32. In previous versions of DF the error_code used to be automatically coerced to Utf8 however with #12308 a coerce_types impl was added that no longer will try to coerce types to Utf8. Instead the sql needs to be changed to the following to work

substr(error_code::varchar, 3)

To Reproduce

select substr(123456, 3);

Expected behavior

type coercion should allow for this to work as it used to.

Additional context

No response

@Omega359 Omega359 added the bug Something isn't working label Oct 29, 2024
@jayzhan211
Copy link
Contributor

In Postgres and DuckDB, they don't accept integer as the first input, I suggest we follow them.

@Omega359
Copy link
Contributor Author

Oh, good point, I didn't think to check that @jayzhan211.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants