You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by ch...@apache.org on 2025/12/31 08:51:07 UTC
(incubator-gluten) 02/16: [Fix] Use class name instead of class object for streaming call detection to ensure Spark 4.1 compatibility.
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 851a222f72317100db02863fce76fcd2aa16b02c
Author: Chang chen <ch...@apache.org>
AuthorDate: Wed Dec 31 11:35:10 2025 +0800
[Fix] Use class name instead of class object for streaming call detection to ensure Spark 4.1 compatibility.
see https://github.com/apache/spark/pull/51477
---
.../scala/org/apache/gluten/extension/caller/CallerInfo.scala | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/gluten-core/src/main/scala/org/apache/gluten/extension/caller/CallerInfo.scala b/gluten-core/src/main/scala/org/apache/gluten/extension/caller/CallerInfo.scala
index 732c898285..7dfaaaa774 100644
--- a/gluten-core/src/main/scala/org/apache/gluten/extension/caller/CallerInfo.scala
+++ b/gluten-core/src/main/scala/org/apache/gluten/extension/caller/CallerInfo.scala
@@ -18,7 +18,7 @@ package org.apache.gluten.extension.caller
import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec
import org.apache.spark.sql.execution.columnar.InMemoryRelation
-import org.apache.spark.sql.execution.streaming.StreamExecution
+import org.apache.spark.util.SparkVersionUtil
/**
* Helper API that stores information about the call site of the columnar rule. Specific columnar
@@ -70,7 +70,12 @@ object CallerInfo {
}
private def inStreamingCall(stack: Seq[StackTraceElement]): Boolean = {
- stack.exists(_.getClassName.equals(StreamExecution.getClass.getName.split('$').head))
+ val streamName = if (SparkVersionUtil.gteSpark41) {
+ "org.apache.spark.sql.execution.streaming.runtime.StreamExecution"
+ } else {
+ "org.apache.spark.sql.execution.streaming.StreamExecution"
+ }
+ stack.exists(_.getClassName.equals(streamName))
}
private def inBloomFilterStatFunctionCall(stack: Seq[StackTraceElement]): Boolean = {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org