Skip to content

[SPARK-6888][SQL] Make the jdbc driver handling user-definable - #5555

Closed
rtreffer wants to merge 2 commits into
apache:masterfrom
rtreffer:jdbc-dialects
Closed

rtreffer wants to merge 2 commits into
apache:masterfrom
rtreffer:jdbc-dialects

Conversation

@rtreffer

Copy link
Copy Markdown
Contributor

Replace the DriverQuirks with JdbcDialect(s) (and MySQLDialect/PostgresDialect)
and allow developers to change the dialects on the fly (for new JDBCRRDs only).

Some types (like an unsigned 64bit number) can be trivially mapped to java.
The status quo is that the RRD will fail to load.
This patch makes it possible to overwrite the type mapping to read e.g.
64Bit numbers as strings and handle them afterwards in software.

JDBCSuite has an example that maps all types to String, which should always
work (at the cost of extra code afterwards).

As a side effect it should now be possible to develop simple dialects
out-of-tree and even with spark-shell.

@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@marmbrus

Copy link
Copy Markdown
Contributor

ok to test

@SparkQA

SparkQA commented Apr 17, 2015

Copy link
Copy Markdown

Test build #30492 has started for PR 5555 at commit 3e98f74.

@SparkQA

SparkQA commented Apr 17, 2015

Copy link
Copy Markdown

Test build #30492 has finished for PR 5555 at commit 3e98f74.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@AmplabJenkins

Copy link
Copy Markdown

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

@marmbrus

Copy link
Copy Markdown
Contributor

Thanks for working on this! Looks like there are some lines that need to be wrapped:

[error] /home/jenkins/workspace/SparkPullRequestBuilder/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:64: File line length exceeds 100 characters
[error] /home/jenkins/workspace/SparkPullRequestBuilder/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:138: File line length exceeds 100 characters
[error] /home/jenkins/workspace/SparkPullRequestBuilder/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:166: File line length exceeds 100 characters
[error] /home/jenkins/workspace/SparkPullRequestBuilder/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:191: File line length exceeds 100 characters

@rtreffer

Copy link
Copy Markdown
Contributor Author

Thank you for the fast feedback, I'm quite impressed by the feedback speed/quality on the spark project.

I was traveling last week, so the fix was a bit delayed.

@rtreffer

Copy link
Copy Markdown
Contributor Author

@marmbrus I've fixed the linebreaks, but jenkins does not seem to pick up the changes and rerun the tests :-( What should I do?

@marmbrus

Copy link
Copy Markdown
Contributor

test this please

@rtreffer

Copy link
Copy Markdown
Contributor Author

@marmbrus what should we do now? New PR?

@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@marmbrus

Copy link
Copy Markdown
Contributor

Ok to test
On Apr 27, 2015 11:18 AM, "UCB AMPLab" notifications@github.com wrote:

Can one of the admins verify this patch?

—
Reply to this email directly or view it on GitHub
#5555 (comment).

@rtreffer

Copy link
Copy Markdown
Contributor Author

Still no build 😢

@marmbrus

Copy link
Copy Markdown
Contributor

Yeah sorry... jenkins was down i think.

@marmbrus

Copy link
Copy Markdown
Contributor

ok to test

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@SparkQA

SparkQA commented Apr 30, 2015

Copy link
Copy Markdown

Test build #31431 has started for PR 5555 at commit 6a528d4.

@SparkQA

SparkQA commented Apr 30, 2015

Copy link
Copy Markdown

Test build #31431 has finished for PR 5555 at commit 6a528d4.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. Test FAILed.

@AmplabJenkins

Copy link
Copy Markdown

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

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@SparkQA

SparkQA commented Apr 30, 2015

Copy link
Copy Markdown

Test build #31432 has started for PR 5555 at commit 5ab9be9.

@SparkQA

SparkQA commented Apr 30, 2015

Copy link
Copy Markdown

Test build #31432 has finished for PR 5555 at commit 5ab9be9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. Test PASSed.

@AmplabJenkins

Copy link
Copy Markdown

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

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@SparkQA

SparkQA commented May 17, 2015

Copy link
Copy Markdown

Test build #32949 has started for PR 5555 at commit 5033611.

Replace the DriverQuirks with JdbcDialect(s) (and MySQLDialect/PostgresDialect)
and allow developers to change the dialects on the fly (for new JDBCRRDs only).

Some types (like an unsigned 64bit number) can be trivially mapped to java.
The status quo is that the RRD will fail to load.
This patch makes it possible to overwrite the type mapping to read e.g.
64Bit numbers as strings and handle them afterwards in software.

JDBCSuite has an example that maps all types to String, which should always
work (at the cost of extra code afterwards).
@SparkQA

SparkQA commented May 17, 2015

Copy link
Copy Markdown

Test build #32949 has finished for PR 5555 at commit 5033611.

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

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. Test FAILed.

@AmplabJenkins

Copy link
Copy Markdown

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

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@rtreffer

Copy link
Copy Markdown
Contributor Author

Rebased on master, squashed, added a case class for the JdbcType and got rid of null.

@rtreffer

Copy link
Copy Markdown
Contributor Author

Jenkins failes with

[info] spark-sql: found 5 potential binary incompatibilities (filtered 287)
[error]  * object org.apache.spark.sql.jdbc.DriverQuirks does not have a correspondent in new version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("org.apache.spark.sql.jdbc.DriverQuirks$")
[error]  * class org.apache.spark.sql.jdbc.DriverQuirks does not have a correspondent in new version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("org.apache.spark.sql.jdbc.DriverQuirks")
[error]  * class org.apache.spark.sql.jdbc.PostgresQuirks does not have a correspondent in new version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("org.apache.spark.sql.jdbc.PostgresQuirks")
[error]  * class org.apache.spark.sql.jdbc.NoQuirks does not have a correspondent in new version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("org.apache.spark.sql.jdbc.NoQuirks")
[error]  * class org.apache.spark.sql.jdbc.MySQLQuirks does not have a correspondent in new version
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("org.apache.spark.sql.jdbc.MySQLQuirks")

but that was the intention of the rename.

@rxin

rxin commented May 17, 2015

Copy link
Copy Markdown
Contributor

@rtreffer you can change MimaExcludes.scala to include the exclude rules.

@SparkQA

SparkQA commented May 17, 2015

Copy link
Copy Markdown

Test build #32951 has started for PR 5555 at commit fe7e2e8.

@SparkQA

SparkQA commented May 17, 2015

Copy link
Copy Markdown

Test build #32951 has finished for PR 5555 at commit fe7e2e8.

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

@rtreffer

Copy link
Copy Markdown
Contributor Author

@rxin thank you, found the MimaExcludes, let's see if I've done that correctly.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@SparkQA

SparkQA commented May 18, 2015

Copy link
Copy Markdown

Test build #32979 has started for PR 5555 at commit 3cbafd7.

@SparkQA

SparkQA commented May 18, 2015

Copy link
Copy Markdown

Test build #32979 has finished for PR 5555 at commit 3cbafd7.

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

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. Test PASSed.

@AmplabJenkins

Copy link
Copy Markdown

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

@asfgit asfgit closed this in e1ac2a9 May 18, 2015
@marmbrus

Copy link
Copy Markdown
Contributor

Thanks! Merged to master and 1.4

asfgit pushed a commit that referenced this pull request May 18, 2015
Replace the DriverQuirks with JdbcDialect(s) (and MySQLDialect/PostgresDialect)
and allow developers to change the dialects on the fly (for new JDBCRRDs only).

Some types (like an unsigned 64bit number) can be trivially mapped to java.
The status quo is that the RRD will fail to load.
This patch makes it possible to overwrite the type mapping to read e.g.
64Bit numbers as strings and handle them afterwards in software.

JDBCSuite has an example that maps all types to String, which should always
work (at the cost of extra code afterwards).

As a side effect it should now be possible to develop simple dialects
out-of-tree and even with spark-shell.

Author: Rene Treffer <treffer@measite.de>

Closes #5555 from rtreffer/jdbc-dialects and squashes the following commits:

3cbafd7 [Rene Treffer] [SPARK-6888] ignore classes belonging to changed API in MIMA report
fe7e2e8 [Rene Treffer] [SPARK-6888] Make the jdbc driver handling user-definable
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request May 28, 2015
Replace the DriverQuirks with JdbcDialect(s) (and MySQLDialect/PostgresDialect)
and allow developers to change the dialects on the fly (for new JDBCRRDs only).

Some types (like an unsigned 64bit number) can be trivially mapped to java.
The status quo is that the RRD will fail to load.
This patch makes it possible to overwrite the type mapping to read e.g.
64Bit numbers as strings and handle them afterwards in software.

JDBCSuite has an example that maps all types to String, which should always
work (at the cost of extra code afterwards).

As a side effect it should now be possible to develop simple dialects
out-of-tree and even with spark-shell.

Author: Rene Treffer <treffer@measite.de>

Closes apache#5555 from rtreffer/jdbc-dialects and squashes the following commits:

3cbafd7 [Rene Treffer] [SPARK-6888] ignore classes belonging to changed API in MIMA report
fe7e2e8 [Rene Treffer] [SPARK-6888] Make the jdbc driver handling user-definable
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request Jun 12, 2015
Replace the DriverQuirks with JdbcDialect(s) (and MySQLDialect/PostgresDialect)
and allow developers to change the dialects on the fly (for new JDBCRRDs only).

Some types (like an unsigned 64bit number) can be trivially mapped to java.
The status quo is that the RRD will fail to load.
This patch makes it possible to overwrite the type mapping to read e.g.
64Bit numbers as strings and handle them afterwards in software.

JDBCSuite has an example that maps all types to String, which should always
work (at the cost of extra code afterwards).

As a side effect it should now be possible to develop simple dialects
out-of-tree and even with spark-shell.

Author: Rene Treffer <treffer@measite.de>

Closes apache#5555 from rtreffer/jdbc-dialects and squashes the following commits:

3cbafd7 [Rene Treffer] [SPARK-6888] ignore classes belonging to changed API in MIMA report
fe7e2e8 [Rene Treffer] [SPARK-6888] Make the jdbc driver handling user-definable
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
Replace the DriverQuirks with JdbcDialect(s) (and MySQLDialect/PostgresDialect)
and allow developers to change the dialects on the fly (for new JDBCRRDs only).

Some types (like an unsigned 64bit number) can be trivially mapped to java.
The status quo is that the RRD will fail to load.
This patch makes it possible to overwrite the type mapping to read e.g.
64Bit numbers as strings and handle them afterwards in software.

JDBCSuite has an example that maps all types to String, which should always
work (at the cost of extra code afterwards).

As a side effect it should now be possible to develop simple dialects
out-of-tree and even with spark-shell.

Author: Rene Treffer <treffer@measite.de>

Closes apache#5555 from rtreffer/jdbc-dialects and squashes the following commits:

3cbafd7 [Rene Treffer] [SPARK-6888] ignore classes belonging to changed API in MIMA report
fe7e2e8 [Rene Treffer] [SPARK-6888] Make the jdbc driver handling user-definable
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