-
Notifications
You must be signed in to change notification settings - Fork 227
Feat: support bit_get function #1713
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this PR supposed to replace the #1602 PR ?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1713 +/- ##
============================================
+ Coverage 56.12% 58.47% +2.34%
- Complexity 976 1141 +165
============================================
Files 119 131 +12
Lines 11743 12897 +1154
Branches 2251 2396 +145
============================================
+ Hits 6591 7541 +950
- Misses 4012 4134 +122
- Partials 1140 1222 +82 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Same comment as in #1602 (#1602 (comment)) |
# Conflicts: # native/spark-expr/src/bitwise_funcs/mod.rs # native/spark-expr/src/comet_scalar_funcs.rs # spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala # spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
# Conflicts: # native/spark-expr/src/bitwise_funcs/mod.rs # spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala
# Conflicts: # native/spark-expr/src/bitwise_funcs/mod.rs # native/spark-expr/src/comet_scalar_funcs.rs
@kazantsev-maksim I took the liberty of upmerging this PR @parthchandra @comphead could you take another look when you have a chance? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
val bitwiseNotExpr = expr.asInstanceOf[BitwiseNot] | ||
val childProto = exprToProto(bitwiseNotExpr.child, inputs, binding) | ||
val bitNotScalarExpr = | ||
scalarFunctionExprToProto("bit_not", childProto) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find such function 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function based on: native/spark-expr/src/bitwise_funcs/bitwise_not.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks @andygrove I cannot find bit_not
function but it is not related to this specific PR
Which issue does this PR close?
Related to Epic: #240
bit_get: SELECT bit_get(0) => 0
DataFusionComet bit_get has same behavior with Spark 's bit_get function
Spark: https://spark.apache.org/docs/latest/api/sql/index.html#bit_get
Closes #.
Rationale for this change
Defined under Epic: #240
What changes are included in this PR?
bitwise_get.rs: impl for bit_get function
QueryPlanSerde.scala: bit_get pattern matching case has been added,
bitwise.scala: The bit_get function is the last function of the bitwise expressions type from the epic: #240. I moved them into a separate file, following the same approach as with the array functions.
CometBitwiseExpressionSuite.scala: A new UT has been added for bit_get function.
How are these changes tested?
A new UT has been added.