-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 for BitwiseAnd &
, BitOr |
binary operators
#1619
Comments
I have investigated the bitwise operations in the PG database. |
If you want to take this task, it's better to give a plan for �implementation. |
I think this would be a fairly straightforward task of adding |
This is a good project for anyone who wants to learn how operators are implemented in DataFusion |
I can take some tasks of this issue if you have a plan to implement it. |
The only bitwise operator left to support is Thanks all! |
I am curious if the unary operator ~ has been implemented . I was unable to find any relevant implementation. |
I would say no DataFusion CLI v20.0.0 |
I believe adding the bitwise ~ operator would be beneficial for the completeness of bitwise operations. Therefore, I would like to request the implementation of this operator. Could you please provide some guidance on how I could proceed with implementing this operator? Any help or suggestions would be greatly appreciated. |
Thank you -- that sounds great. I will comment on #5700 |
My parquet file contains a bitpacked
flags
(i32, but pretend it's u32). The 2nd bit inflags
indicates whether the record is a potato or not. I would like to be able to access this from SQL.Describe the solution you'd like
I think, in SQL, this would look like:
I'd also be happy with it having a boolean output:
These operators (but not the binary literals) parse, but cannot be planned:
This makes
&
a regular binary operator, like%
or even+
, although I wouldn't implement it forDecimal
, or even signed integers, to start?In my application I am going to be checking multiple flags, so any syntax which could be optimised would be great for me.
Postgres produces the integer output, instead of boolean.
Describe alternatives you've considered
You can fake this, to some extent, with (integer)
/
and%2
.You can (outside of the CLI, my favourite place to run SQL) register custom functions, like
is_potato(flags)
.I have also considered a custom function like
bits_set(flags, "1001") -> bool
? This is valuable to readability as there's no support for the0b1001
binary literal syntax in the SQL at the moment, but its performance is bad, 'cos you end up with a long list of strings passed to your function.The text was updated successfully, but these errors were encountered: