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-12446][SQL] Add unit tests for JDBCRDD internal functions #10409

Closed
wants to merge 5 commits into from

Conversation

maropu
Copy link
Member

@maropu maropu commented Dec 21, 2015

No tests done for JDBCRDD#compileFilter.

@SparkQA
Copy link

SparkQA commented Dec 21, 2015

Test build #48097 has finished for PR 10409 at commit ed94623.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Dec 22, 2015

Test build #48142 has finished for PR 10409 at commit 9932f06.

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

@@ -168,6 +168,35 @@ private[sql] object JDBCRDD extends Logging {
}

/**
* Converts value to SQL expression.
*/
private def compileValue(value: Any): Any = value match {
Copy link
Contributor

Choose a reason for hiding this comment

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

did you just move this code block, or was there any changes made?

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 just moved compileValue, escapeSql, and compileFilter in this companion object area.

@rxin
Copy link
Contributor

rxin commented Dec 22, 2015

Let me know once you address my comments. This looks pretty good, assuming you mostly just moved the code to become static functions.

*/
private def compileValue(value: Any): Any = value match {
case stringValue: String => s"'${escapeSql(stringValue)}'"
case timestampValue: Timestamp => "'" + timestampValue + "'"
Copy link
Member Author

Choose a reason for hiding this comment

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

@rxin `s"'$timestampValue'"`` is better here?

Copy link
Contributor

Choose a reason for hiding this comment

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

both works - i wouldn't worry about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay.

@maropu
Copy link
Member Author

maropu commented Dec 22, 2015

@rxin Finished.

@rxin
Copy link
Contributor

rxin commented Dec 22, 2015

LGTM. We should merge this as soon as tests pass.

@SparkQA
Copy link

SparkQA commented Dec 22, 2015

Test build #2244 has finished for PR 10409 at commit 46c0e7f.

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

@rxin
Copy link
Contributor

rxin commented Dec 22, 2015

Thanks - I've merged this.

@asfgit asfgit closed this in 8c1b867 Dec 22, 2015
@SparkQA
Copy link

SparkQA commented Dec 22, 2015

Test build #2245 has finished for PR 10409 at commit 46c0e7f.

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

@SparkQA
Copy link

SparkQA commented Dec 22, 2015

Test build #2246 has finished for PR 10409 at commit 46c0e7f.

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

asfgit pushed a commit that referenced this pull request Dec 3, 2016
…functions

No tests done for JDBCRDD#compileFilter.

Author: Takeshi YAMAMURO <linguin.m.sgmail.com>

Closes #10409 from maropu/AddTestsInJdbcRdd.

(cherry picked from commit 8c1b867)

Author: Takeshi YAMAMURO <[email protected]>

Closes #16124 from dongjoon-hyun/SPARK-12446-BRANCH-1.6.
zzcclp added a commit to zzcclp/spark that referenced this pull request Dec 5, 2016
…functions

No tests done for JDBCRDD#compileFilter.

Author: Takeshi YAMAMURO [email protected]

Closes apache#10409 from maropu/AddTestsInJdbcRdd.

(cherry picked from commit 8c1b867)
@maropu maropu deleted the AddTestsInJdbcRdd branch July 5, 2017 11:48
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