apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
5.51k stars 1.02k forks source link

Make error message better when `bitwise_*` operator takes wrong argument type #11249

Open 2010YOUY01 opened 4 days ago

2010YOUY01 commented 4 days ago

Describe the bug

This is not a bug, but the error message can be better: The following queries' problem is just bitwise_* operator takes the not-supported argument type, so it should be a planning error. Current Internal error messages can be confusing, or cause a false positive for testing code.

> select 2.0 << 1.5;
Internal error: Data type Float64 not supported for binary operation 'bitwise_shift_left' 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
> select 3.14 >> 1.2;
Internal error: Data type Float64 not supported for binary operation 'bitwise_shift_right' 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
> select 3.14 | 1.3;
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
> select 1.3 ^ 3.14;
Internal error: Data type Float64 not supported for binary operation 'bitwise_xor' 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
> select 1.5 & 1.6;
Internal error: Data type Float64 not supported for binary operation 'bitwise_and' 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

To Reproduce

No response

Expected behavior

No response

Additional context

No response

dharanad commented 3 days ago

take