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-4613][Core] Java API for JdbcRDD #3478

Closed
wants to merge 3 commits into from

Conversation

liancheng
Copy link
Contributor

This PR introduces a set of Java APIs for using JdbcRDD:

  1. Trait (interface) JdbcRDD.ConnectionFactory: equivalent to the getConnection: () => Connection parameter in JdbcRDD constructor.
  2. Two overloaded versions of Jdbc.create: used to create JavaRDD that wraps a JdbcRDD.

Review on Reviewable

@SparkQA
Copy link

SparkQA commented Nov 26, 2014

Test build #23888 has started for PR 3478 at commit ffcdf2e.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Nov 26, 2014

Test build #23888 has finished for PR 3478 at commit ffcdf2e.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • trait ConnectionFactory extends Serializable

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/23888/
Test FAILed.

@pwendell
Copy link
Contributor

@liancheng this appears to have failed its own test :P

@liancheng
Copy link
Contributor Author

@pwendell Yea, I don't see why it can't find Derby driver, and I can't reproduce it locally :(

@mateiz
Copy link
Contributor

mateiz commented Nov 26, 2014

Maybe it got it from the Java or Hadoop version. You can add a test dep on Derby.

@SparkQA
Copy link

SparkQA commented Nov 27, 2014

Test build #23912 has started for PR 3478 at commit d4cedc5.

  • This patch merges cleanly.

@liancheng
Copy link
Contributor Author

@mateiz The thing puzzles me is that Derby has already been added as a test dependency in Spark core, otherwise the Scala JdbcRDDSuite couldn't pass.

@SparkQA
Copy link

SparkQA commented Nov 27, 2014

Test build #23912 has finished for PR 3478 at commit d4cedc5.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • trait ConnectionFactory extends Serializable

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/23912/
Test FAILed.

@liancheng
Copy link
Contributor Author

Found the cause. JdbcRDDSuite deletes the temporary Derby database with shutdown=true, but didn't specify a database name. In this way, the whole Derby driver is shut down. Thus, when executing JavaJdbcRDDSuite after JdbcRDDSuite, it fails.

@SparkQA
Copy link

SparkQA commented Nov 27, 2014

Test build #23917 has started for PR 3478 at commit 9a54625.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Nov 27, 2014

Test build #23917 has finished for PR 3478 at commit 9a54625.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • trait ConnectionFactory extends Serializable

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/23917/
Test PASSed.

@mateiz
Copy link
Contributor

mateiz commented Nov 28, 2014

Looks good to me; going to merge it.

asfgit pushed a commit that referenced this pull request Nov 28, 2014
This PR introduces a set of Java APIs for using `JdbcRDD`:

1. Trait (interface) `JdbcRDD.ConnectionFactory`: equivalent to the `getConnection: () => Connection` parameter in `JdbcRDD` constructor.
2. Two overloaded versions of `Jdbc.create`: used to create `JavaRDD` that wraps a `JdbcRDD`.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/apache/spark/3478)
<!-- Reviewable:end -->

Author: Cheng Lian <lian@databricks.com>

Closes #3478 from liancheng/japi-jdbc-rdd and squashes the following commits:

9a54625 [Cheng Lian] Only shutdowns a single DB rather than the whole Derby driver
d4cedc5 [Cheng Lian] Moves Java JdbcRDD test case to a separate test suite
ffcdf2e [Cheng Lian] Java API for JdbcRDD

(cherry picked from commit 120a350)
Signed-off-by: Matei Zaharia <matei@databricks.com>
@asfgit asfgit closed this in 120a350 Nov 28, 2014
@liancheng liancheng deleted the japi-jdbc-rdd branch November 28, 2014 03:15
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.

5 participants