You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/11/11 01:08:50 UTC
[GitHub] [spark] HyukjinKwon commented on a change in pull request #33510: [SPARK-36223][SQL][TEST] Cover 3 kinds of join in the TPCDSQueryTestSuite
HyukjinKwon commented on a change in pull request #33510:
URL: https://github.com/apache/spark/pull/33510#discussion_r747127736
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/TPCDSQueryTestSuite.scala
##########
@@ -131,16 +132,44 @@ class TPCDSQueryTestSuite extends QueryTest with TPCDSBase with SQLQueryTestHelp
}
assertResult(expectedSchema, s"Schema did not match\n$queryString") { schema }
- assertResult(expectedOutput, s"Result did not match\n$queryString") { outputString }
+ if (needSort) {
+ val expectSorted = expectedOutput.split("\n").sorted.map(_.trim)
+ .mkString("\n").replaceAll("\\s+$", "")
+ val outputSorted = output.sorted.map(_.trim).mkString("\n").replaceAll("\\s+$", "")
+ assertResult(expectSorted, s"Result did not match\n$queryString") { outputSorted }
+ } else {
+ assertResult(expectedOutput, s"Result did not match\n$queryString") { outputString }
+ }
}
+ val broadcastHashJoinConf = Map(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "10485760")
+
+ val sortMergeJoinConf = Map(
+ SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1",
+ SQLConf.PREFER_SORTMERGEJOIN.key -> "true")
+
+ val shuffleHashJoinConf = Map(
+ SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1",
+ "spark.sql.join.forceApplyShuffledHashJoin" -> "true")
+
+ val shuffleConfSet: Set[Map[String, String]] =
+ Set(broadcastHashJoinConf, sortMergeJoinConf, shuffleHashJoinConf);
+
if (tpcdsDataPath.nonEmpty) {
tpcdsQueries.foreach { name =>
val queryString = resourceToString(s"tpcds/$name.sql",
classLoader = Thread.currentThread().getContextClassLoader)
test(name) {
val goldenFile = new File(s"$baseResourcePath/v1_4", s"$name.sql.out")
- runQuery(queryString, goldenFile)
+ runQuery(queryString, goldenFile, false)
+ if (!regenerateGoldenFiles) {
+ shuffleConfSet.foreach { testConf =>
Review comment:
Does it always run the queries even when the queries don't have joins?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org