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

Numeric, String, Boolean comparisons with literal NULL #2482

Closed
Tracked by #2483
WinkerDu opened this issue May 7, 2022 · 1 comment
Closed
Tracked by #2483

Numeric, String, Boolean comparisons with literal NULL #2482

WinkerDu opened this issue May 7, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@WinkerDu
Copy link
Contributor

WinkerDu commented May 7, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
As discuss in #1179 , there is bug when Numeric, String, Boolean comparisons work with literal NULL

Toproduce

> select * from (VALUES (1, 'foo' ,2.3), (2, 'bar', 5.4)) as t;
+---------+---------+---------+
| column1 | column2 | column3 |
+---------+---------+---------+
| 1       | foo     | 2.3     |
| 2       | bar     | 5.4     |
+---------+---------+---------+
2 rows in set. Query took 0.004 seconds.
> select column1 < null from (VALUES (1, 'foo' ,2.3), (2, 'bar', 5.4)) as t;
Plan("'Int64 < Utf8' can't be evaluated because there isn't a common type to coerce the types to")
> select column2 < null from (VALUES (1, 'foo' ,2.3), (2, 'bar', 5.4)) as t;
ArrowError(ExternalError(Internal("compute_utf8_op_scalar for 'lt' failed to cast literal value NULL")))
> select column3 < null from (VALUES (1, 'foo' ,2.3), (2, 'bar', 5.4)) as t;
Plan("'Float64 < Utf8' can't be evaluated because there isn't a common type to coerce the types to")

Describe the solution you'd like

  • Introduces null_coercion to comparison_eq_coercion and comparison_order_coercion
  • Enhances binary expression macros to support NULL scalar value comparing with array, like binary_array_op_dyn_scalar
@WinkerDu
Copy link
Contributor Author

closed by #2481

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

1 participant