Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLUTEN-8926][CH] MergeTree Parameter Configuration Optimization to Prevent Multithreading Competition for activeSession Being None #8927

Merged
merged 1 commit into from
Mar 7, 2025
Merged
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 @@ -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