From 033784c691880083d798c4be1653cb40fc28da87 Mon Sep 17 00:00:00 2001 From: Brian Yue Date: Thu, 9 Sep 2021 13:36:34 +0800 Subject: [PATCH] [KYUUBI #1018] Set spark.sql.execution.topKSortFallbackThreshold to 10000 ### _Why are the changes needed?_ To avoid performance issues in the topK scenario and close #1018 . ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1054 from byyue/feature-1018. Closes #1018 21de1fcb [Brian Yue] Set spark.sql.execution.topKSortFallbackThreshold to 10000 Authored-by: Brian Yue Signed-off-by: Kent Yao --- .../scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala index 6968e07ce65..9c2832c57ce 100644 --- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala +++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala @@ -96,6 +96,7 @@ object SparkSQLEngine extends Logging { def createSpark(): SparkSession = { val sparkConf = new SparkConf() + sparkConf.setIfMissing("spark.sql.execution.topKSortFallbackThreshold", "10000") sparkConf.setIfMissing("spark.sql.legacy.castComplexTypesToString.enabled", "true") sparkConf.setIfMissing("spark.master", "local") sparkConf.setIfMissing("spark.ui.port", "0")