Skip to content

Commit

Permalink
disable columnar table cache in default
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangyang Gao committed Oct 23, 2023
1 parent 327b8eb commit 043cf83
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ListenerApiImpl extends ListenerApi {

override def onDriverStart(conf: SparkConf): Unit = {
// sql table cache serializer
if (conf.getBoolean(GlutenConfig.COLUMNAR_TABLE_CACHE_ENABLED.key, defaultValue = true)) {
if (conf.getBoolean(GlutenConfig.COLUMNAR_TABLE_CACHE_ENABLED.key, defaultValue = false)) {
conf.set(
StaticSQLConf.SPARK_CACHE_SERIALIZER.key,
"org.apache.spark.sql.execution.ColumnarCachedBatchSerializer")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,21 @@ class VeloxColumnarCacheSuite extends VeloxWholeStageTransformerSuite with Adapt
}
}

test("Support transform count(1) with table cache") {
val cached = spark.table("lineitem").cache()
try {
val df = spark.sql("SELECT COUNT(*) FROM lineitem")
checkAnswer(df, Row(60175))
assert(
find(df.queryExecution.executedPlan) {
case _: RowToVeloxColumnarExec => true
case _ => false
}.isEmpty
)
} finally {
cached.unpersist()
}
}
// test("Support transform count(1) with table cache") {
// val cached = spark.table("lineitem").cache()
// try {
// val df = spark.sql("SELECT COUNT(*) FROM lineitem")
// checkAnswer(df, Row(60175))
// assert(
// find(df.queryExecution.executedPlan) {
// case _: RowToVeloxColumnarExec => true
// case _ => false
// }.isEmpty
// )
// } finally {
// cached.unpersist()
// }
// }

test("no ColumnarToRow for table cache") {
val cached = spark.table("lineitem").cache()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ class VeloxTestSettings extends BackendTestSettings {
// requires resource files from Vanilla spark jar
.exclude("SPARK-32908: maximum target error in percentile_approx")
enableSuite[GlutenCachedTableSuite]
.exclude("InMemoryRelation statistics")
.exclude("GLUTEN - InMemoryRelation statistics")
// Extra ColumnarToRow is needed to transform vanilla columnar data to gluten columnar data.
.exclude("SPARK-37369: Avoid redundant ColumnarToRow transition on InMemoryTableScan")
enableSuite[GlutenFileSourceCharVarcharTestSuite]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ object GlutenConfig {
.internal()
.doc("Enable or disable columnar table cache.")
.booleanConf
.createWithDefault(true)
.createWithDefault(false)

val COLUMNAR_PHYSICAL_JOIN_OPTIMIZATION_THROTTLE =
buildConf("spark.gluten.sql.columnar.physicalJoinOptimizationLevel")
Expand Down

0 comments on commit 043cf83

Please sign in to comment.