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

Improve repeat so it errors if the second argument is a non integer #14376

Open
alamb opened this issue Jan 30, 2025 · 2 comments
Open

Improve repeat so it errors if the second argument is a non integer #14376

alamb opened this issue Jan 30, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Jan 30, 2025

Is your feature request related to a problem or challenge?

Prior to #14268, the following query would error:

select repeat('-1.2', 3.2);
query error DataFusion error: Error during planning: Internal error: Expect TypeSignatureClass::Native\(LogicalType\(Native\(Int64\), Int64\)\) but received Float64

After #14268 it appends 3 copies (ignores the .2 part

DataFusion CLI v44.0.0
> select repeat('-1.2', 3.2);
+-----------------------------------+
| repeat(Utf8("-1.2"),Float64(3.2)) |
+-----------------------------------+
| -1.2-1.2-1.2                      |
+-----------------------------------+
1 row(s) fetched.
Elapsed 0.023 seconds.

Describe the solution you'd like

Per @jayzhan211 the query should error if the second argument is a non intger: https://github.com/apache/datafusion/pull/14268/files#r1933031384

I still think non-integer 2nd arg should return error

Describe alternatives you've considered

No response

Additional context

No response

@alamb alamb added the enhancement New feature or request label Jan 30, 2025
@jonathanc-n
Copy link
Contributor

take

@alamb
Copy link
Contributor Author

alamb commented Jan 30, 2025

FYI @jonathanc-n it is not clear to me what should happen with #14268 (if it will be merged or not)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants