Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.apache.gluten.datasource.ArrowCSVFileFormat

import org.apache.spark.SparkConf
import org.apache.spark.sql.execution.{ArrowFileSourceScanExec, BaseArrowScanExec, ColumnarToRowExec}
import org.apache.spark.sql.execution.columnar.SparkCacheUtil
import org.apache.spark.sql.types.{IntegerType, StringType, StructType}

import org.scalatest.Ignore
Expand Down Expand Up @@ -83,6 +84,18 @@ class ArrowCsvScanWithTableCacheSuite extends ArrowCsvScanSuiteBase {
.set(GlutenConfig.COLUMNAR_TABLE_CACHE_ENABLED.key, "true")
}

override def beforeAll(): Unit = {
super.beforeAll()
// A common practice as well as in Spark tests, to clear the cache serializer
// in case it was already set as the default row-based serializer.
SparkCacheUtil.clearCacheSerializer()
}

override def afterAll(): Unit = {
SparkCacheUtil.clearCacheSerializer()
super.afterAll()
}

/**
* Test for GLUTEN-8453: https://github.com/apache/incubator-gluten/issues/8453. To make sure no
* error is thrown when caching an Arrow Java query plan.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.apache.spark.SparkConf
import org.apache.spark.sql.Row
import org.apache.spark.sql.execution.{ColumnarToRowExec, SparkPlan}
import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper
import org.apache.spark.sql.execution.columnar.InMemoryTableScanExec
import org.apache.spark.sql.execution.columnar.{InMemoryTableScanExec, SparkCacheUtil}
import org.apache.spark.sql.types.{LongType, Metadata, MetadataBuilder, StructType}
import org.apache.spark.storage.StorageLevel

Expand All @@ -35,9 +35,17 @@ class VeloxColumnarCacheSuite extends VeloxWholeStageTransformerSuite with Adapt

override def beforeAll(): Unit = {
super.beforeAll()
// A common practice as well as in Spark tests, to clear the cache serializer
// in case it was already set as the default row-based serializer.
SparkCacheUtil.clearCacheSerializer()
createTPCHNotNullTables()
}

override protected def afterAll(): Unit = {
SparkCacheUtil.clearCacheSerializer()
super.afterAll()
}

override protected def sparkConf: SparkConf = {
super.sparkConf
.set("spark.shuffle.manager", "org.apache.spark.shuffle.sort.ColumnarShuffleManager")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.sql.execution.columnar

object SparkCacheUtil {
def clearCacheSerializer(): Unit = {
InMemoryRelation.clearSerializer()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ object GlutenConfig {
.createWithDefault(100000)

val COLUMNAR_TABLE_CACHE_ENABLED =
buildConf("spark.gluten.sql.columnar.tableCache")
buildStaticConf("spark.gluten.sql.columnar.tableCache")
.doc("Enable or disable columnar table cache.")
.booleanConf
.createWithDefault(false)
Expand Down