Skip to content

Commit

Permalink
[GLUTEN-8926][CH] MergeTree Parameter Configuration Optimization to P…
Browse files Browse the repository at this point in the history
…revent Multithreading Competition for activeSession Being None (#8927)
  • Loading branch information
gleonSun authored Mar 7, 2025
1 parent d7d9d05 commit 5170be1
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ case class FilterExprsAsKey(
}

object ClickhouseSnapshot {
protected def sparkSession: SparkSession = SparkSession.active

val deltaScanCache: Cache[FilterExprsAsKey, DeltaScan] = CacheBuilder.newBuilder
.maximumSize(
SparkSession.getActiveSession.get.conf
sparkSession.conf
.get(CHBackendSettings.GLUTEN_CLICKHOUSE_DELTA_SCAN_CACHE_SIZE, "10000")
.toLong)
.expireAfterAccess(7200L, TimeUnit.SECONDS)
Expand All @@ -95,7 +97,7 @@ object ClickhouseSnapshot {

val addFileToAddMTPCache: LoadingCache[AddFileAsKey, AddMergeTreeParts] = CacheBuilder.newBuilder
.maximumSize(
SparkSession.getActiveSession.get.conf
sparkSession.conf
.get(CHBackendSettings.GLUTEN_CLICKHOUSE_ADDFILES_TO_MTPS_CACHE_SIZE, "1000000")
.toLong)
.expireAfterAccess(7200L, TimeUnit.SECONDS)
Expand All @@ -109,7 +111,7 @@ object ClickhouseSnapshot {

val pathToAddMTPCache: Cache[String, AddMergeTreeParts] = CacheBuilder.newBuilder
.maximumSize(
SparkSession.getActiveSession.get.conf
sparkSession.conf
.get(CHBackendSettings.GLUTEN_CLICKHOUSE_TABLE_PATH_TO_MTPS_CACHE_SIZE, "1000000")
.toLong)
.expireAfterAccess(7200L, TimeUnit.SECONDS)
Expand Down

0 comments on commit 5170be1

Please sign in to comment.