This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new c9d56758a8c [SPARK-39856][TESTS][INFRA] Skip q72 at TPC-DS build at 
GitHub Actions
c9d56758a8c is described below

commit c9d56758a8c28a44161f63eb5c8763ab92616a56
Author: Hyukjin Kwon <gurwls...@apache.org>
AuthorDate: Tue Jul 26 18:25:50 2022 +0900

    [SPARK-39856][TESTS][INFRA] Skip q72 at TPC-DS build at GitHub Actions
    
    ### What changes were proposed in this pull request?
    
    This PR reverts 
https://github.com/apache/spark/commit/7358253755762f9bfe6cedc1a50ec14616cfeace,
 
https://github.com/apache/spark/commit/ae1f6a26ed39b297ace8d6c9420b72a3c01a3291 
and 
https://github.com/apache/spark/commit/72b55ccf8327c00e173ab6130fdb428ad0d5aacc 
because they do not help fixing the TPC-DS build.
    
    In addition, this PR skips the problematic query in GitHub Actions to avoid 
OOM.
    
    ### Why are the changes needed?
    
    To make the build pass.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, dev and test-only.
    
    ### How was this patch tested?
    
    CI in this PR should test it out.
    
    Closes #37289 from HyukjinKwon/SPARK-39856-followup.
    
    Authored-by: Hyukjin Kwon <gurwls...@apache.org>
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
    (cherry picked from commit de9a4b0747a4127e320f80f5e1bf431429da70a9)
    Signed-off-by: Hyukjin Kwon <gurwls...@apache.org>
---
 .../org/apache/spark/sql/TPCDSQuerySuite.scala     |  6 ++++--
 .../org/apache/spark/sql/TPCDSQueryTestSuite.scala | 23 ++++++++++++----------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala 
b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala
index 22e1b838f3f..8c4d25a7eb9 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala
@@ -29,7 +29,8 @@ import org.apache.spark.tags.ExtendedSQLTest
 @ExtendedSQLTest
 class TPCDSQuerySuite extends BenchmarkQueryTest with TPCDSBase {
 
-  tpcdsQueries.foreach { name =>
+  // q72 is skipped due to GitHub Actions' memory limit.
+  tpcdsQueries.filterNot(sys.env.contains("GITHUB_ACTIONS") && _ == 
"q72").foreach { name =>
     val queryString = resourceToString(s"tpcds/$name.sql",
       classLoader = Thread.currentThread().getContextClassLoader)
     test(name) {
@@ -39,7 +40,8 @@ class TPCDSQuerySuite extends BenchmarkQueryTest with 
TPCDSBase {
     }
   }
 
-  tpcdsQueriesV2_7_0.foreach { name =>
+  // q72 is skipped due to GitHub Actions' memory limit.
+  tpcdsQueriesV2_7_0.filterNot(sys.env.contains("GITHUB_ACTIONS") && _ == 
"q72").foreach { name =>
     val queryString = resourceToString(s"tpcds-v2.7.0/$name.sql",
       classLoader = Thread.currentThread().getContextClassLoader)
     test(s"$name-v2.7") {
diff --git 
a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQueryTestSuite.scala 
b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQueryTestSuite.scala
index 9affe827bc1..8019fc98a52 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQueryTestSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQueryTestSuite.scala
@@ -62,7 +62,7 @@ class TPCDSQueryTestSuite extends QueryTest with TPCDSBase 
with SQLQueryTestHelp
 
   // To make output results deterministic
   override protected def sparkConf: SparkConf = super.sparkConf
-    .set(SQLConf.SHUFFLE_PARTITIONS.key, 32.toString)
+    .set(SQLConf.SHUFFLE_PARTITIONS.key, "1")
 
   protected override def createSparkSession: TestSparkSession = {
     new TestSparkSession(new SparkContext("local[1]", 
this.getClass.getSimpleName, sparkConf))
@@ -105,6 +105,7 @@ class TPCDSQueryTestSuite extends QueryTest with TPCDSBase 
with SQLQueryTestHelp
       query: String,
       goldenFile: File,
       conf: Map[String, String]): Unit = {
+    val shouldSortResults = sortMergeJoinConf != conf  // Sort for other joins
     withSQLConf(conf.toSeq: _*) {
       try {
         val (schema, output) = handleExceptions(getNormalizedResult(spark, 
query))
@@ -142,15 +143,17 @@ class TPCDSQueryTestSuite extends QueryTest with 
TPCDSBase with SQLQueryTestHelp
         assertResult(expectedSchema, s"Schema did not match\n$queryString") {
           schema
         }
-        // Truncate precisions because they can be vary per how the shuffle is 
performed.
-        val expectSorted = expectedOutput.split("\n").sorted.map(_.trim)
-          .mkString("\n").replaceAll("\\s+$", "")
-          .replaceAll("""([0-9]+.[0-9]{10})([0-9]*)""", "$1")
-        val outputSorted = output.sorted.map(_.trim).mkString("\n")
-          .replaceAll("\\s+$", "")
-          .replaceAll("""([0-9]+.[0-9]{10})([0-9]*)""", "$1")
-        assertResult(expectSorted, s"Result did not match\n$queryString") {
-          outputSorted
+        if (shouldSortResults) {
+          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
+          }
         }
       } catch {
         case e: Throwable =>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to