Skip to content

Commit 2362082

Browse files
committed
Use SQLConf to configure in-memory columnar caching
1 parent 2c35666 commit 2362082

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import java.util.Properties
2222
import scala.collection.JavaConverters._
2323

2424
object SQLConf {
25+
val COMPRESS_CACHED = "spark.sql.inMemoryColumnarStorage.compressed"
2526
val AUTO_BROADCASTJOIN_THRESHOLD = "spark.sql.autoBroadcastJoinThreshold"
2627
val SHUFFLE_PARTITIONS = "spark.sql.shuffle.partitions"
2728
val DEFAULT_SIZE_IN_BYTES = "spark.sql.defaultSizeInBytes"
@@ -49,6 +50,9 @@ trait SQLConf {
4950
/** ************************ Spark SQL Params/Hints ******************* */
5051
// TODO: refactor so that these hints accessors don't pollute the name space of SQLContext?
5152

53+
/** When true tables cached using the in-memory columnar caching will be compressed. */
54+
private[spark] def useCompression: Boolean = get(COMPRESS_CACHED, "false").toBoolean
55+
5256
/** Number of partitions to use for shuffle operators. */
5357
private[spark] def numShufflePartitions: Int = get(SHUFFLE_PARTITIONS, "200").toInt
5458

sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ class SQLContext(@transient val sparkContext: SparkContext)
192192
currentTable.logicalPlan
193193

194194
case _ =>
195-
val useCompression =
196-
sparkContext.conf.getBoolean("spark.sql.inMemoryColumnarStorage.compressed", false)
197195
InMemoryRelation(useCompression, executePlan(currentTable).executedPlan)
198196
}
199197

0 commit comments

Comments
 (0)