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

LEAST(), GREATEST(), BETWEEN() do not work for string values #177

Closed
ohaibbq opened this issue Feb 27, 2024 · 0 comments · Fixed by #182
Closed

LEAST(), GREATEST(), BETWEEN() do not work for string values #177

ohaibbq opened this issue Feb 27, 2024 · 0 comments · Fixed by #182

Comments

@ohaibbq
Copy link
Contributor

ohaibbq commented Feb 27, 2024

The current implementation of these function converts the arguments into either Float64() or Int64() types.

The zetasql analyzer will assert that the argument types are homogenous, so we can update our implementations to use .GT(), etc

SELECT GREATEST("a", 2)
No matching signature for function GREATEST for argument types: STRING, INT64. Supported signature: GREATEST([ANY, ...]) [at 1:8]

SELECT LEAST("a", "b"), GREATEST("a", "b"), "b" between "a" and "c";

Expected

col1 col2 col3
a b true

Actual

failed to scan rows: strconv.ParseFloat: parsing "a": invalid syntax
failed to scan rows: strconv.ParseInt: parsing "b": invalid syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant