Skip to content

Commit c07b8c1

Browse files
committed
lazy_coalesce_fallback_case_statement
1 parent 9de380d commit c07b8c1

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,16 +1248,8 @@ object QueryPlanSerde extends Logging with CometExprShim {
12481248
None
12491249
}
12501250

1251-
// case a @ Coalesce(_) =>
1252-
// val branches = a.children.dropRight(1).map { child =>
1253-
// (IsNotNull(child), child)
1254-
// }
1255-
// val elseValue = Some(a.children.last)
1256-
//
1257-
// exprToProtoInternal(CaseWhen(branches, elseValue), inputs, binding)
1258-
//
1259-
// val exprChildren = a.children.map(exprToProtoInternal(_, inputs, binding))
1260-
// scalarFunctionExprToProto("coalesce", exprChildren: _*)
1251+
// DataFusion coalesce doesnt perform lazy evaluation. Falling back to CASE statement until upstream data fusion issue is fixed
1252+
// https://github.com/apache/datafusion/pull/17357/files
12611253

12621254
case c @ (CaseWhen(_, _) | Coalesce(_)) =>
12631255
val (finalBranches, finalElse) = c match {

0 commit comments

Comments
 (0)