Skip to content

Commit 97eecf4

Browse files
committed
fix: provide fallback reasons for Generate and ArrayFilter operators
When CometExplodeExec.convert was called with an empty childOp (child operator not native), it propagated tags from output attributes which never have explain info, resulting in "Generate [COMET: ]" with no reason. Split the check to provide an explicit message for the non-native child case. Also add a missing reason to CometArrayFilter.getSupportLevel for unsupported filter functions.
1 parent c3f59a6 commit 97eecf4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,8 @@ object CometArrayFilter extends CometExpressionSerde[ArrayFilter] {
622622
override def getSupportLevel(expr: ArrayFilter): SupportLevel = {
623623
expr.function.children.headOption match {
624624
case Some(_: IsNotNull) => Compatible()
625-
case _ => Unsupported()
625+
case _ =>
626+
Unsupported(Some("Only array_compact (ArrayFilter with IsNotNull) is supported"))
626627
}
627628
}
628629

spark/src/main/scala/org/apache/spark/sql/comet/operators.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,12 @@ object CometExplodeExec extends CometOperatorSerde[GenerateExec] {
12171217
exprToProto(attr, op.child.output)
12181218
}
12191219

1220-
if (projectExprs.exists(_.isEmpty) || childOp.isEmpty) {
1220+
if (childOp.isEmpty) {
1221+
withInfo(op, s"${op.nodeName} is not native because the child operator is not native")
1222+
return None
1223+
}
1224+
1225+
if (projectExprs.exists(_.isEmpty)) {
12211226
withInfo(op, op.output: _*)
12221227
return None
12231228
}

0 commit comments

Comments
 (0)