This is an automated email from the ASF dual-hosted git repository.

changchen pushed a commit to branch feature/41
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git

commit 939dac2e7707144c91166e24d2c640e504b4d06a
Author: Chang chen <[email protected]>
AuthorDate: Tue Dec 16 17:57:30 2025 +0800

    [Fix] Adapt to QueryExecution.createSparkPlan interface change
    
    see https://github.com/apache/spark/pull/50598
---
 .../spark/sql/execution/GlutenImplicits.scala      |  7 ++---
 .../spark/sql/execution/QueryExecutionShim.scala   | 32 +++++++++++++++++++++
 .../spark/sql/execution/QueryExecutionShim.scala   | 32 +++++++++++++++++++++
 .../spark/sql/execution/QueryExecutionShim.scala   | 32 +++++++++++++++++++++
 .../spark/sql/execution/QueryExecutionShim.scala   | 32 +++++++++++++++++++++
 .../spark/sql/execution/QueryExecutionShim.scala   | 33 ++++++++++++++++++++++
 .../spark/sql/execution/QueryExecutionShim.scala   | 32 +++++++++++++++++++++
 7 files changed, 195 insertions(+), 5 deletions(-)

diff --git 
a/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenImplicits.scala
 
b/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenImplicits.scala
index 474a271769..29036619ae 100644
--- 
a/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenImplicits.scala
+++ 
b/gluten-substrait/src/main/scala/org/apache/spark/sql/execution/GlutenImplicits.scala
@@ -19,7 +19,6 @@ package org.apache.spark.sql.execution
 import org.apache.gluten.exception.GlutenException
 import org.apache.gluten.execution.{GlutenPlan, WholeStageTransformer}
 import org.apache.gluten.utils.PlanUtil
-
 import org.apache.spark.sql.{Column, Dataset, SparkSession}
 import org.apache.spark.sql.catalyst.plans.QueryPlan
 import org.apache.spark.sql.catalyst.plans.logical.{CommandResult, LogicalPlan}
@@ -130,10 +129,8 @@ object GlutenImplicits {
           val (innerNumGlutenNodes, innerFallbackNodeToReason) =
             withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") {
               // re-plan manually to skip cached data
-              val newSparkPlan = QueryExecution.createSparkPlan(
-                spark,
-                spark.sessionState.planner,
-                p.inputPlan.logicalLink.get)
+              val newSparkPlan = QueryExecutionShim.createSparkPlan(
+                spark, spark.sessionState.planner, p.inputPlan.logicalLink.get)
               val newExecutedPlan = QueryExecution.prepareExecutedPlan(
                 spark,
                 newSparkPlan
diff --git 
a/shims/spark32/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
 
b/shims/spark32/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
new file mode 100644
index 0000000000..3a8fa6fd2a
--- /dev/null
+++ 
b/shims/spark32/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
+
+/**
+ * Shim layer for DataSourceV2Relation to maintain compatibility across 
different Spark versions.
+ */
+object QueryExecutionShim {
+
+  /** @since Spark 4.1 */
+  def createSparkPlan(
+      sparkSession: SparkSession,
+      planner: SparkPlanner,
+      plan: LogicalPlan): SparkPlan = 
QueryExecution.createSparkPlan(sparkSession, planner, plan)
+}
diff --git 
a/shims/spark33/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
 
b/shims/spark33/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
new file mode 100644
index 0000000000..3a8fa6fd2a
--- /dev/null
+++ 
b/shims/spark33/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
+
+/**
+ * Shim layer for DataSourceV2Relation to maintain compatibility across 
different Spark versions.
+ */
+object QueryExecutionShim {
+
+  /** @since Spark 4.1 */
+  def createSparkPlan(
+      sparkSession: SparkSession,
+      planner: SparkPlanner,
+      plan: LogicalPlan): SparkPlan = 
QueryExecution.createSparkPlan(sparkSession, planner, plan)
+}
diff --git 
a/shims/spark34/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
 
b/shims/spark34/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
new file mode 100644
index 0000000000..3a8fa6fd2a
--- /dev/null
+++ 
b/shims/spark34/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
+
+/**
+ * Shim layer for DataSourceV2Relation to maintain compatibility across 
different Spark versions.
+ */
+object QueryExecutionShim {
+
+  /** @since Spark 4.1 */
+  def createSparkPlan(
+      sparkSession: SparkSession,
+      planner: SparkPlanner,
+      plan: LogicalPlan): SparkPlan = 
QueryExecution.createSparkPlan(sparkSession, planner, plan)
+}
diff --git 
a/shims/spark35/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
 
b/shims/spark35/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
new file mode 100644
index 0000000000..3a8fa6fd2a
--- /dev/null
+++ 
b/shims/spark35/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
+
+/**
+ * Shim layer for DataSourceV2Relation to maintain compatibility across 
different Spark versions.
+ */
+object QueryExecutionShim {
+
+  /** @since Spark 4.1 */
+  def createSparkPlan(
+      sparkSession: SparkSession,
+      planner: SparkPlanner,
+      plan: LogicalPlan): SparkPlan = 
QueryExecution.createSparkPlan(sparkSession, planner, plan)
+}
diff --git 
a/shims/spark40/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
 
b/shims/spark40/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
new file mode 100644
index 0000000000..7a3602e4fc
--- /dev/null
+++ 
b/shims/spark40/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
+import org.apache.spark.sql.classic.ClassicConversions._
+
+/**
+ * Shim layer for DataSourceV2Relation to maintain compatibility across 
different Spark versions.
+ */
+object QueryExecutionShim {
+
+  /** @since Spark 4.1 */
+  def createSparkPlan(
+      sparkSession: SparkSession,
+      planner: SparkPlanner,
+      plan: LogicalPlan): SparkPlan = 
QueryExecution.createSparkPlan(sparkSession, planner, plan)
+}
diff --git 
a/shims/spark41/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
 
b/shims/spark41/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
new file mode 100644
index 0000000000..2331ed875f
--- /dev/null
+++ 
b/shims/spark41/src/main/scala/org/apache/spark/sql/execution/QueryExecutionShim.scala
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.spark.sql.execution
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
+
+/**
+ * Shim layer for DataSourceV2Relation to maintain compatibility across 
different Spark versions.
+ */
+object QueryExecutionShim {
+
+  /** @since Spark 4.1 */
+  def createSparkPlan(
+      sparkSession: SparkSession,
+      planner: SparkPlanner,
+      plan: LogicalPlan): SparkPlan = QueryExecution.createSparkPlan(planner, 
plan)
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to