forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50157][SQL] Using SQLConf provided by SparkSession first
### What changes were proposed in this pull request? This PR proposes to use `SQLConf` provided by `SparkSession` first. ### Why are the changes needed? `SQLConf` provided by `SparkSession` have better perf than `SQLConf.get`. ### Does this PR introduce _any_ user-facing change? 'No'. ### How was this patch tested? GA tests. The benchmark test. ``` object SQLConfBenchmark extends SqlBasedBenchmark { override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { runBenchmark("Get SQLConf") { val iters = 1000 val benchmark = new Benchmark("Benchmark SQLConf", iters, output = output) benchmark.addCase("SQLConf.get") { _ => for (_ <- 1 to iters) { val conf = SQLConf.get } } benchmark.addCase("sessionState.conf") { _ => for (_ <- 1 to iters) { val conf = spark.sessionState.conf } } benchmark.run() } } } ``` The benchmark output. ``` Benchmark SQLConf: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ SQLConf.get 0 0 1 22.9 43.6 1.0X sessionState.conf 0 0 0 1377.4 0.7 60.1X ``` ### Was this patch authored or co-authored using generative AI tooling? 'No'. Closes apache#48693 from beliefer/SPARK-50157. Authored-by: beliefer <[email protected]> Signed-off-by: beliefer <[email protected]>
- Loading branch information
Showing
11 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters