Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Jul 7, 2024
1 parent ce9879f commit dd44bfe
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,13 @@ abstract class CometNativeExec extends CometExec {
*/
protected def canonicalizePlans(): CometNativeExec = {
def transform(arg: Any): AnyRef = arg match {
case sparkPlan: SparkPlan if !sparkPlan.isInstanceOf[CometNativeExec] =>
case sparkPlan: SparkPlan
if !sparkPlan.isInstanceOf[CometNativeExec] &&
children.forall(_ != sparkPlan) =>
// Different to Spark, Comet native query node might have a Spark plan as Product element.
// We need to canonicalize the Spark plan. But it cannot be another Comet native query node,
// otherwise it will cause recursive canonicalization.
sparkPlan.canonicalized
null
case other: AnyRef => other
case null => null
}
Expand Down

0 comments on commit dd44bfe

Please sign in to comment.