andygrove commented on code in PR #1053:
URL: https://github.com/apache/datafusion-comet/pull/1053#discussion_r1829546725
##########
spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala:
##########
@@ -1086,155 +1086,67 @@ object QueryPlanSerde extends Logging with
ShimQueryPlanSerde with CometExprShim
None
case EqualTo(left, right) =>
- val leftExpr = exprToProtoInternal(left, inputs)
- val rightExpr = exprToProtoInternal(right, inputs)
-
- if (leftExpr.isDefined && rightExpr.isDefined) {
- val builder = ExprOuterClass.Equal.newBuilder()
- builder.setLeft(leftExpr.get)
- builder.setRight(rightExpr.get)
-
- Some(
- ExprOuterClass.Expr
- .newBuilder()
- .setEq(builder)
- .build())
- } else {
- withInfo(expr, left, right)
- None
+ createBinaryExpr(left, right, inputs).map { builder =>
+ ExprOuterClass.Expr
+ .newBuilder()
+ .setEq(builder)
+ .build()
Review Comment:
This block of code is specifically for creating `BinaryExpr eq = 9` (note
the call to `setEq` that uses the result of `createBinaryExpr`). Each of these
20 similar blocks of code is for setting a specific top-level `expr_struct`. It
is only the contained `BinaryExpr` struct that is common to each one. Does that
make sense?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]