Skip to content

Commit

Permalink
Driver should not init velox cache in local mode
Browse files Browse the repository at this point in the history
  • Loading branch information
leoluan2009 committed Nov 14, 2024
1 parent 73c0610 commit 604abc3
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class VeloxListenerApi extends ListenerApi with Logging {

SparkDirectoryUtil.init(conf)
UDFResolver.resolveUdfConf(conf, isDriver = true)
initialize(conf)
initialize(conf, isDriver = true)
UdfJniWrapper.registerFunctionSignatures()
}

Expand All @@ -116,12 +116,12 @@ class VeloxListenerApi extends ListenerApi with Logging {

SparkDirectoryUtil.init(conf)
UDFResolver.resolveUdfConf(conf, isDriver = false)
initialize(conf)
initialize(conf, isDriver = false)
}

override def onExecutorShutdown(): Unit = shutdown()

private def initialize(conf: SparkConf): Unit = {
private def initialize(conf: SparkConf, isDriver: Boolean): Unit = {
// Force batch type initializations.
VeloxBatch.getClass
ArrowJavaBatch.getClass
Expand Down Expand Up @@ -157,7 +157,10 @@ class VeloxListenerApi extends ListenerApi with Logging {
}

// Initial native backend with configurations.
val parsed = GlutenConfigUtil.parseConfig(conf.getAll.toMap)
var parsed = GlutenConfigUtil.parseConfig(conf.getAll.toMap)
if (isDriver && !inLocalMode(conf)) {
parsed += (GlutenConfig.COLUMNAR_VELOX_CACHE_ENABLED.key -> "false")
}
NativeBackendInitializer.initializeBackend(parsed)

// Inject backend-specific implementations to override spark classes.
Expand Down

0 comments on commit 604abc3

Please sign in to comment.