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

Internal error when there is a bitwise operation in order by clause (SQLancer) #11561

Open
2010YOUY01 opened this issue Jul 20, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@2010YOUY01
Copy link
Contributor

Describe the bug

Bitwise operations are producing various inconsistent behavior during fuzzing.
The root cause seems to be bitwise operation evaluation (maybe related to #11260)

However, when bitwise operations are used in the ORDER BY clause, other SORT-related errors show up.
We could investigate if this bitwise operation bug might propagate into the SORT logic.

To Reproduce

Reproduce in datafusion-cli
This is a potential bug in bitwise operation, | of two DOUBLE type should not be allowed, it should yield a planning error, but in this case it produces an internal error (#11249)

> select (0.7|0.8);
Internal error: Data type Float64 not supported for binary operation 'bitwise_or' on dyn arrays.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

However, when this expression is placed in order by clause, some query can execute successfully, some query can trigger another internal error in sort logic.

> /*DML*/CREATE TABLE t1(v0 BOOLEAN);
/*DML*/CREATE TABLE t3(v0 BOOLEAN, v1 BIGINT);
0 row(s) fetched.
Elapsed 0.058 seconds.

0 row(s) fetched.
Elapsed 0.002 seconds.

> SELECT * FROM t3 NATURAL JOIN t1 ORDER BY (0.7 | 0.8);
+----+----+
| v1 | v0 |
+----+----+
+----+----+
0 row(s) fetched.
Elapsed 0.084 seconds.

> SELECT * FROM t3 NATURAL JOIN t1 ORDER BY (0.7 | 0.8) > 0;
Internal error: Sort expressions cannot be empty for streaming merge.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

Expected behavior

No response

Additional context

Found by SQLancer #11030

@2010YOUY01 2010YOUY01 added the bug Something isn't working label Jul 20, 2024
@nix010
Copy link

nix010 commented Jul 22, 2024

take

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

No branches or pull requests

2 participants