diff --git a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala index 307e1db9ae34..8474fd6164e9 100644 --- a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala +++ b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala @@ -29,7 +29,7 @@ import org.apache.spark.api.plugin.PluginContext import org.apache.spark.internal.Logging import org.apache.spark.sql.execution.datasources.velox.{VeloxOrcWriterInjects, VeloxParquetWriterInjects, VeloxRowSplitter} import org.apache.spark.sql.expression.UDFResolver -import org.apache.spark.sql.internal.GlutenConfigUtil +import org.apache.spark.sql.internal.{GlutenConfigUtil, StaticSQLConf} import org.apache.spark.util.{SparkDirectoryUtil, SparkResourceUtil} import org.apache.commons.lang3.StringUtils @@ -50,6 +50,12 @@ class VeloxListenerApi extends ListenerApi with Logging { // Static initializers for driver. val conf = pc.conf() + // Sql table cache serializer. + if (conf.getBoolean(GlutenConfig.COLUMNAR_TABLE_CACHE_ENABLED.key, defaultValue = false)) { + conf.set( + StaticSQLConf.SPARK_CACHE_SERIALIZER.key, + "org.apache.spark.sql.execution.ColumnarCachedBatchSerializer") + } SparkDirectoryUtil.init(conf) UDFResolver.resolveUdfConf(conf, isDriver = true) initialize(conf) diff --git a/gluten-core/src/main/scala/org/apache/gluten/GlutenPlugin.scala b/gluten-core/src/main/scala/org/apache/gluten/GlutenPlugin.scala index 4db7fe7508fc..dbf927909187 100644 --- a/gluten-core/src/main/scala/org/apache/gluten/GlutenPlugin.scala +++ b/gluten-core/src/main/scala/org/apache/gluten/GlutenPlugin.scala @@ -263,13 +263,6 @@ private[gluten] class GlutenDriverPlugin extends DriverPlugin with Logging { throw new IllegalArgumentException(s"${GlutenConfig.COLUMNAR_VELOX_CACHE_ENABLED.key} and " + s"${GlutenConfig.COLUMNAR_VELOX_FILE_HANDLE_CACHE_ENABLED.key} should be enabled together.") } - - // Sql table cache serializer. - if (conf.getBoolean(GlutenConfig.COLUMNAR_TABLE_CACHE_ENABLED.key, defaultValue = false)) { - conf.set( - StaticSQLConf.SPARK_CACHE_SERIALIZER.key, - "org.apache.spark.sql.execution.ColumnarCachedBatchSerializer") - } } }