Skip to content

Commit 9ad3176

Browse files
BIGOBIGO
BIGO
authored and
BIGO
committed
fix review
1 parent 72b4f2f commit 9ad3176

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

backends-clickhouse/src/main/scala/org/apache/gluten/backendsapi/clickhouse/CHSparkPlanExecApi.scala

+3
Original file line numberDiff line numberDiff line change
@@ -942,4 +942,7 @@ class CHSparkPlanExecApi extends SparkPlanExecApi with Logging {
942942
child: Seq[SparkPlan]): ColumnarRangeBaseExec =
943943
throw new GlutenNotSupportException("ColumnarRange is not supported in ch backend.")
944944

945+
override def collapsedExpressionSupported(expr: ScalaUDF): Boolean =
946+
CollapsedExpressionMappings.supported(expr.udfName.getOrElse(""))
947+
945948
}

gluten-substrait/src/main/scala/org/apache/gluten/backendsapi/SparkPlanExecApi.scala

+1
Original file line numberDiff line numberDiff line change
@@ -704,4 +704,5 @@ trait SparkPlanExecApi {
704704
outputAttributes: Seq[Attribute],
705705
child: Seq[SparkPlan]): ColumnarRangeBaseExec
706706

707+
def collapsedExpressionSupported(expr: ScalaUDF): Boolean = false
707708
}

gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionConverter.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ object ExpressionConverter extends SQLConfHelper with Logging {
160160
expr match {
161161
case p: PythonUDF =>
162162
return replacePythonUDFWithExpressionTransformer(p, attributeSeq, expressionsMap)
163-
case s: ScalaUDF if CollapsedExpressionMappings.supported(s.udfName.getOrElse("")) =>
163+
case s: ScalaUDF
164+
if BackendsApiManager.getSparkPlanExecApiInstance.collapsedExpressionSupported(s) =>
164165
return replaceCollapsedExpressionWithExpressionTransformer(s, attributeSeq, expressionsMap)
165166
case s: ScalaUDF =>
166167
return replaceScalaUDFWithExpressionTransformer(s, attributeSeq, expressionsMap)

0 commit comments

Comments
 (0)