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

[SPARK-35385][SQL][TESTS] Skip duplicate queries in the TPCDS-related tests #32520

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.apache.spark.sql.test.SharedSparkSession
trait TPCDSBase extends SharedSparkSession with TPCDSSchema {

// The TPCDS queries below are based on v1.4
def tpcdsQueries: Seq[String] = Seq(
private val tpcdsAllQueries: Seq[String] = Seq(
"q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11",
"q12", "q13", "q14a", "q14b", "q15", "q16", "q17", "q18", "q19", "q20",
"q21", "q22", "q23a", "q23b", "q24a", "q24b", "q25", "q26", "q27", "q28", "q29", "q30",
Expand All @@ -36,6 +36,12 @@ trait TPCDSBase extends SharedSparkSession with TPCDSSchema {
"q81", "q82", "q83", "q84", "q85", "q86", "q87", "q88", "q89", "q90",
"q91", "q92", "q93", "q94", "q95", "q96", "q97", "q98", "q99")

// Since `tpcdsQueriesV2_7_0` has almost the same queries with these oens below,
// we skip them in the TPCDS-related tests.
Copy link
Member

@dongjoon-hyun dongjoon-hyun May 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hides the previous reasoning. I believe it's worth to keep SPARK-35327 comment explicitly.

SPARK-35327: Filters out the TPC-DS queries that can cause flaky test results

Copy link
Member Author

@maropu maropu May 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, updated.

private val excludedTpcdsQueries: Set[String] = Set("q6", "q34", "q64", "q74", "q75", "q78")

val tpcdsQueries: Seq[String] = tpcdsAllQueries.filterNot(excludedTpcdsQueries.contains)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another idea:

val tpcdsQueries: Seq[String] = 1.to(99).map("q" + _).flatMap { q => 
  if (Seq("q14", "q23", "q24", "q39").contains(q)) Seq(q + "a", q + "b") else Seq(q)
}.filterNot { q =>
  // ...
  Seq("q6", "q34", "q64", "q74", "q75", "q78").contains(q)
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel the if part looks a bit tricky, so I prefer to keep it as it is.


// This list only includes TPCDS v2.7 queries that are different from v1.4 ones
val tpcdsQueriesV2_7_0 = Seq(
"q5a", "q6", "q10a", "q11", "q12", "q14", "q14a", "q18a",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ class TPCDSQueryTestSuite extends QueryTest with TPCDSBase with SQLQueryTestHelp
.toFile.getAbsolutePath
}

override val tpcdsQueries = {
// SPARK-35327: Filters out the TPC-DS queries that can cause flaky test results
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to the new location too.

val excludedQueries = Set("q6", "q75")
super.tpcdsQueries.filterNot(excludedQueries.contains)
}

override def createTable(
spark: SparkSession,
tableName: String,
Expand Down