Skip to content

Conversation

@dilipbiswal
Copy link
Contributor

@dilipbiswal dilipbiswal commented May 20, 2019

What changes were proposed in this pull request?

This is a minor pr to use # as a marker for expression id that is embedded in the name field of SubqueryExec operator.

How was this patch tested?

Added a small test in SubquerySuite.

@SparkQA
Copy link

SparkQA commented May 20, 2019

Test build #105577 has finished for PR 24652 at commit 55e6eea.

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

@dilipbiswal
Copy link
Contributor Author

cc @gatorsmile @maryannxue

Copy link
Member

@gatorsmile gatorsmile left a comment

Choose a reason for hiding this comment

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

LGTM

@dongjoon-hyun
Copy link
Member

Retest this please.


-- TC 03.01
-- explain a simple uncorelated scalar subquery
SET spark.sql.codegen.wholeStage = true;
Copy link
Member

Choose a reason for hiding this comment

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

So, this is a workaround to avoid SQLQueryTestSuite's codegenConfigSets combinations, right?

Copy link
Contributor Author

@dilipbiswal dilipbiswal May 26, 2019

Choose a reason for hiding this comment

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

@dongjoon-hyun Yes.. this is to bypass the codegenconfigsets combination.. Do you want to move this test case to a new .sql instead of modifying an existing one ?

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

For this PR, it might be a simple workaround to turn off three combination of codegenConfigSets. However, this will bite us when we add a new test case later at the end of the file.

SET spark.sql.codegen.wholeStage = true;

As you needed to add a workaround, it seems that SQLQueryTestSuite is not designed to serve well this kind of use case. Please move this test coverage from scalar-subquery-predicate.sql to another test suite.

@SparkQA
Copy link

SparkQA commented May 26, 2019

Test build #105783 has finished for PR 24652 at commit 55e6eea.

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

@dilipbiswal
Copy link
Contributor Author

dilipbiswal commented May 26, 2019

@dongjoon-hyun

As you needed to add a workaround, it seems that SQLQueryTestSuite is not designed to serve well this kind of use case. Please move this test coverage from scalar-subquery-predicate.sql to another test suite.

Actually i am working on the new explain item and would like to test the new format out by using the SQLQueryTestSuite framework as much as possible as there would be so many combinations of plans. I was thinking to improve SQLQueryTestSuite to introduce a new list/map to have a list of test cases per codegen config or something in that direction. Or may be have 2 output files one for codegen on and one for codegen off. Please let me know what you think.

@dongjoon-hyun
Copy link
Member

For this specific PR, please use another test suite as I recommended before. For your suggestion, please file another JIRA because that is not relevant to this tiny PR. Your suggestion will be a massive PR, isn't it?

FROM t2
WHERE t2c = t1c
GROUP BY t2c);

Copy link
Member

Choose a reason for hiding this comment

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

Ur, please revert this, too. And we need to update PR description. Especially, the following. We had better keep narrow context in this PR.

This is to help SQLQueryTestSuite anonymize these expression ids.

}
}

test("SPARK-27782 scalar subquuery name should start with scalar-subquery#") {
Copy link
Member

@dongjoon-hyun dongjoon-hyun May 26, 2019

Choose a reason for hiding this comment

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

subquuery -> subquery.
And, please remove SPARK-27782 since this is a new feature instead of bug. We use JIRA id for bugs in general.

|SELECT a
|FROM l
|WHERE a = (SELECT max(c) FROM r WHERE c = 1)
""".stripMargin)
Copy link
Member

Choose a reason for hiding this comment

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

Since this is very short, can we have one-liner?

val df = sql("SELECT a FROM l WHERE a = (SELECT max(c) FROM r WHERE c = 1)")

@SparkQA
Copy link

SparkQA commented May 26, 2019

Test build #105801 has finished for PR 24652 at commit 631eb28.

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

@SparkQA
Copy link

SparkQA commented May 27, 2019

Test build #105804 has finished for PR 24652 at commit 4d6ab9a.

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

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Merged to master!
Thank you, @dilipbiswal and @gatorsmile .

@dilipbiswal
Copy link
Contributor Author

@dongjoon-hyun Thank you very much @gatorsmile @dongjoon-hyun

@dongjoon-hyun
Copy link
Member

You're welcome always!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants