zml1206 commented on code in PR #6855:
URL: https://github.com/apache/incubator-gluten/pull/6855#discussion_r1719485266
##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxListenerApi.scala:
##########
@@ -27,138 +26,67 @@ import org.apache.gluten.vectorized.{JniLibLoader,
JniWorkspace}
import org.apache.spark.{SparkConf, SparkContext}
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, StaticSQLConf}
-import org.apache.spark.util.SparkDirectoryUtil
+import org.apache.spark.sql.internal.GlutenConfigUtil
+import org.apache.spark.util.{SparkDirectoryUtil, SparkResourceUtil}
import org.apache.commons.lang3.StringUtils
-import scala.sys.process._
+import java.util.concurrent.atomic.AtomicBoolean
-class VeloxListenerApi extends ListenerApi {
- private val ARROW_VERSION = "1500"
+class VeloxListenerApi extends ListenerApi with Logging {
+ import VeloxListenerApi._
override def onDriverStart(sc: SparkContext, pc: PluginContext): Unit = {
- 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")
+ if (!driverInitialized.compareAndSet(false, true)) {
+ // Make sure we call the static initializers only once.
+ logInfo(
+ "Skip rerunning static initializers since they are only supposed to
run once." +
+ " You see this message probably because you are creating a new
SparkSession.")
Review Comment:
If just re-create sparkSession, it will not restart the driver. Re-creating
sparkContext will restart the driver, but a new sparkConf may be set, so is it
better to re-initialize it once?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]