Weijun-H commented on code in PR #6968:
URL: https://github.com/apache/datafusion-comet/pull/6968#discussion_r4277738682
##########
spark/src/main/scala/org/apache/comet/serde/CometSortOrder.scala:
##########
@@ -86,7 +78,13 @@ object CometSortOrder extends
CometExpressionSerde[SortOrder] {
expr: SortOrder,
inputs: Seq[Attribute],
binding: Boolean): Option[ExprOuterClass.Expr] = {
- val childExpr = exprToProtoInternal(expr.child, inputs, binding)
+ val wrapped = if (needsRootNullWrapper(expr)) {
+ CreateNamedStruct(
+ Seq(Literal("root_null"), IsNull(expr.child), Literal("value"),
expr.child))
+ } else {
+ expr.child
+ }
Review Comment:
Agreed, the key can be evaluated twice; the determinism guard keeps results
consistent. A dedicated node or CSE is a broader change, so I'd leave it for a
follow-up.
--
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]