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

Support boolean == boolean and boolean != boolean operators #1159

Closed
alamb opened this issue Oct 21, 2021 · 0 comments · Fixed by #1163
Closed

Support boolean == boolean and boolean != boolean operators #1159

alamb opened this issue Oct 21, 2021 · 0 comments · Fixed by #1163
Assignees
Labels
datafusion Changes in the datafusion crate enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Oct 21, 2021

Describe the bug
I found this while working on #1153

Trying to do a boolean operation with eq or != results in an error such as:

ArrowError(ExternalError(Internal("Data type Boolean not supported for binary operation on dyn arrays")))

To Reproduce

echo "true" > /tmp/foo.csv
echo "false" >> /tmp/foo.csv

cargo run --bin datafusion-cli

Then run SQL:

CREATE EXTERNAL TABLE foo(x boolean)
STORED AS CSV
LOCATION '/tmp/foo.csv';

> select * from foo;
+-------+
| x     |
+-------+
| true  |
| false |
+-------+
2 rows in set. Query took 0.010 seconds.
> select x != x from foo;
ArrowError(ExternalError(Internal("Data type Boolean not supported for binary operation on dyn arrays")))

Expected behavior
Expect the query to run and the a result of two columns of false values

Additional context
The reason it is a problem for constant folding, is that there is special case code to handle constant true != false type expressions but it doesn't work with the general purpose constant evaluator.

@alamb alamb added bug Something isn't working datafusion Changes in the datafusion crate labels Oct 21, 2021
@alamb alamb self-assigned this Oct 21, 2021
@alamb alamb added enhancement New feature or request and removed bug Something isn't working labels Feb 10, 2022
@alamb alamb changed the title boolean == boolean and boolean != boolean operators are not supported Support boolean == boolean and boolean != boolean operators Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate enhancement New feature or request
Projects
None yet
1 participant