From 3b3de1787b8fe6b1b40844ef048d028deb122433 Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Mon, 17 Jun 2024 10:25:20 -0700 Subject: [PATCH] fix: Avoid resursive call to canonicalizePlans --- .../src/main/scala/org/apache/spark/sql/comet/operators.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spark/src/main/scala/org/apache/spark/sql/comet/operators.scala b/spark/src/main/scala/org/apache/spark/sql/comet/operators.scala index 394e4b156..c32bb0c1c 100644 --- a/spark/src/main/scala/org/apache/spark/sql/comet/operators.scala +++ b/spark/src/main/scala/org/apache/spark/sql/comet/operators.scala @@ -381,7 +381,8 @@ abstract class CometNativeExec extends CometExec { */ protected def canonicalizePlans(): CometNativeExec = { def transform(arg: Any): AnyRef = arg match { - case sparkPlan: SparkPlan => sparkPlan.canonicalized + case sparkPlan: SparkPlan if !sparkPlan.isInstanceOf[CometNativeExec] => + sparkPlan.canonicalized case other: AnyRef => other case null => null }