Skip to content

[SPARK-29873][SQL][Test][FOLLOWUP] set operations should not escape when regen golden file with --SET --import both specified #26557

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

Closed
wants to merge 6 commits into from

Conversation

yaooqinn
Copy link
Member

What changes were proposed in this pull request?

When regenerating golden files, the set operations via --SET will not be done, but those with --import should be exceptions because we need the set command.

Why are the changes needed?

fix test tool.

Does this PR introduce any user-facing change?

How was this patch tested?

add ut, but I'm not sure we need these tests for tests itself.
cc @maropu @cloud-fan

@yaooqinn yaooqinn changed the title [SPARK-29873][SQL] set operations should not escape when regen golde file with --SET --import both specified [SPARK-29873][SQL][Test][FOLLOWUP] set operations should not escape when regen golde file with --SET --import both specified Nov 16, 2019
@SparkQA
Copy link

SparkQA commented Nov 16, 2019

Test build #113928 has finished for PR 26557 at commit a854316.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 16, 2019

Test build #113930 has finished for PR 26557 at commit c791b36.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 16, 2019

Test build #113937 has finished for PR 26557 at commit 8fb683e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@@ -285,7 +285,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession {

// When we are regenerating the golden files, we don't need to set any config as they
// all need to return the same result
if (regenerateGoldenFiles || !isTestWithConfigSets) {
if ((regenerateGoldenFiles && importedTestCaseName.isEmpty) || !isTestWithConfigSets) {
Copy link
Contributor

@cloud-fan cloud-fan Nov 18, 2019

Choose a reason for hiding this comment

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

ah seems we have 2 different kinds of settings now:

  1. settings that shouldn't change result. We want to generate the golden files without the settings and run tests with settings.
  2. setting that can change result.

The second one is pretty useful with --import. We want to run the same queries with different settings and save the answers.

Shall we have different directives for them? @maropu

Copy link
Contributor

Choose a reason for hiding this comment

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

After a second thought, we only expect the --SET to change behavior if we import queries. So the change here LGTM.

@yaooqinn can you update the comment to explain it?

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW now --SET is upper case and --import is lower case. Seems better to always use upper case.

Copy link
Contributor

Choose a reason for hiding this comment

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

also cc @wangyum , why do we need isTestWithConfigSets for thriftserver tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I will update the comments and change case for --import

Copy link
Member

Choose a reason for hiding this comment

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

@cloud-fan To reduce the test time. The mvn test often timed out at that time: https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-maven-hadoop-2.7/

Copy link
Contributor

Choose a reason for hiding this comment

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

do you mean setting config is expensive?

Copy link
Member

Choose a reason for hiding this comment

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

It will run configSets times:

configSets.foreach { configSet =>
try {
runQueries(queries, testCase, Some(configSet))
} catch {
case e: Throwable =>
val configs = configSet.map {
case (k, v) => s"$k=$v"
}
logError(s"Error using configs: ${configs.mkString(",")}")
throw e
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

ah that's a problem. We should think about how to reduce test time.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I'm late. The change looks reasonable...

@yaooqinn yaooqinn changed the title [SPARK-29873][SQL][Test][FOLLOWUP] set operations should not escape when regen golde file with --SET --import both specified [SPARK-29873][SQL][Test][FOLLOWUP] set operations should not escape when regen golden file with --SET --import both specified Nov 18, 2019
@SparkQA
Copy link

SparkQA commented Nov 18, 2019

Test build #114006 has finished for PR 26557 at commit 538a44f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Nov 18, 2019

Test build #114007 has finished for PR 26557 at commit 3192e15.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in ea010a2 Nov 18, 2019
@yaooqinn yaooqinn deleted the SPARK-29873 branch November 19, 2019 02:52
@maropu
Copy link
Member

maropu commented Nov 20, 2019

late LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants