From 937c1b3a9334c963e650b60762a86fc26ecbccac Mon Sep 17 00:00:00 2001 From: Jia Ke Date: Thu, 15 Aug 2024 18:00:46 +0800 Subject: [PATCH] Resolve comments --- .../apache/gluten/expression/ExpressionMappings.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala b/gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala index 30b7da504b86..85d7e6a393f5 100644 --- a/gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala +++ b/gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionMappings.scala @@ -18,8 +18,9 @@ package org.apache.gluten.expression import org.apache.gluten.GlutenConfig import org.apache.gluten.backendsapi.BackendsApiManager +import org.apache.gluten.exception.GlutenException import org.apache.gluten.expression.ExpressionNames._ -import org.apache.gluten.extension.{DefaultExpressionExtensionTransformer, ExpressionExtensionTrait} +import org.apache.gluten.extension.ExpressionExtensionTrait import org.apache.gluten.sql.shims.SparkShimLoader import org.apache.spark.sql.catalyst.expressions._ @@ -357,7 +358,11 @@ object ExpressionMappings { private var expressionExtensionTransformer: Option[ExpressionExtensionTrait] = None def getExpressionExtensionTransformer: ExpressionExtensionTrait = { - expressionExtensionTransformer.getOrElse(new DefaultExpressionExtensionTransformer) + if (expressionExtensionTransformer.isEmpty) { + throw new GlutenException( + "The expressionExtensionTransformer is not set properly when ini driver or executor") + } + expressionExtensionTransformer.get } def setExpressionExtensionTransformer(value: ExpressionExtensionTrait): Unit = {