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-21832][TEST] Merge SQLBuilderTest into ExpressionSQLBuilderSuite #19044

Closed
wants to merge 3 commits into from
Closed

[SPARK-21832][TEST] Merge SQLBuilderTest into ExpressionSQLBuilderSuite #19044

wants to merge 3 commits into from

Conversation

dongjoon-hyun
Copy link
Member

What changes were proposed in this pull request?

After SPARK-19025, there is no need to keep SQLBuilderTest.
ExpressionSQLBuilderSuite is the only place to use it.
This PR aims to remove SQLBuilderTest.

How was this patch tested?

Pass the updated ExpressionSQLBuilderSuite.

After SPARK-19025, there is no need to keep SQLBuilderTest.
ExpressionSQLBuilderSuite is the only place to use it.
This PR aims to remove SQLBuilderTest.
}
}

import org.apache.spark.sql.catalyst.dsl.expressions._
Copy link
Member

Choose a reason for hiding this comment

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

Why moving here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for review, @gatorsmile . I thought we can remove SQLBuilderTest because we will use SQL generation on expression level only.

Copy link
Member

Choose a reason for hiding this comment

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

I mean the import.

Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Aug 24, 2017

Choose a reason for hiding this comment

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

Oh, I see. There is overloading issue on ===.

Line 31: === is string comparision.

assert(actualSQL === expectedSQL)

The import is used to make predicate with === in the below test cases.

import org.apache.spark.sql.catalyst.dsl.expressions._

Copy link
Member

Choose a reason for hiding this comment

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

Then, we should move it to the test case it needs such an import. Also add a comment there.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you. I'll update like that.

@SparkQA
Copy link

SparkQA commented Aug 24, 2017

Test build #81101 has finished for PR 19044 at commit 82a9260.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class ExpressionSQLBuilderSuite extends QueryTest with TestHiveSingleton

protected def checkSQL(e: Expression, expectedSQL: String): Unit = {
val actualSQL = e.sql
try {
assert(actualSQL === expectedSQL)
Copy link
Member

Choose a reason for hiding this comment

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

I thought just one test case required that import.

Since most cases require it, you just need to change === => ==. Then, you can move the import to the beginning of this file.

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 see. Yep. That's better.

Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Aug 24, 2017

Choose a reason for hiding this comment

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

The PR is updated. Thanks!

@SparkQA
Copy link

SparkQA commented Aug 25, 2017

Test build #81106 has finished for PR 19044 at commit bc906c8.

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

@gatorsmile
Copy link
Member

gatorsmile commented Aug 25, 2017

LGTM pending Jenkins

@dongjoon-hyun
Copy link
Member Author

Thank you for review, @gatorsmile !

@SparkQA
Copy link

SparkQA commented Aug 25, 2017

Test build #81107 has finished for PR 19044 at commit e042621.

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

@dongjoon-hyun
Copy link
Member Author

Retest this please.

@SparkQA
Copy link

SparkQA commented Aug 25, 2017

Test build #81113 has finished for PR 19044 at commit e042621.

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

@gatorsmile
Copy link
Member

Thanks! Merging to master.

@dongjoon-hyun
Copy link
Member Author

Thank you for review and merging, @gatorsmile .

@asfgit asfgit closed this in 1f24cee Aug 25, 2017
@dongjoon-hyun dongjoon-hyun deleted the SPARK-21832 branch August 26, 2017 03:06
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.

3 participants