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

[BEAM-3773] JDBC #5399

Merged
merged 2 commits into from
May 17, 2018
Merged

[BEAM-3773] JDBC #5399

merged 2 commits into from
May 17, 2018

Conversation

apilloud
Copy link
Member

Add JDBC support to Beam SQL so we can use sqlline.


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand:
    • What the pull request does
    • Why it does it
    • How it does it
    • Why this approach
  • Each commit in the pull request should have a meaningful subject line and body.
  • Run ./gradlew build to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@apilloud
Copy link
Member Author

Failed in :beam-sdks-java-maven-archetypes

@apilloud
Copy link
Member Author

run java precommit

@kennknowles
Copy link
Member

Nice.

@kennknowles
Copy link
Member

Archetypes more like argh!!!etypes

@kennknowles kennknowles merged commit 871307c into apache:master May 17, 2018
@apilloud apilloud deleted the jdbc branch May 17, 2018 21:51
@@ -83,7 +81,7 @@ public static void prepare() {
.context(Contexts.EMPTY_CONTEXT)
.ruleSets(BeamRuleSets.getRuleSets())
.costFactory(null)
Copy link
Contributor

@vectorijk vectorijk May 25, 2018

Choose a reason for hiding this comment

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

@apilloud Could you run unit tests based on this class again? Some tests failed on my machine. It seems this test also need CalciteConnection.
Correct me if I am wrong

Error:

java.sql.SQLException: No suitable driver found for jdbc:beam:
	at java.sql.DriverManager.getConnection(DriverManager.java:689)
	at java.sql.DriverManager.getConnection(DriverManager.java:270)
	at org.apache.beam.sdk.extensions.sql.impl.JdbcDriverTest.testDriverManager_parse(JdbcDriverTest.java:56)

Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting. The tests pass for me. How are you running them? Are you using maven or gradle?

Copy link
Member Author

Choose a reason for hiding this comment

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

@vectorijk Tests passed for me in both maven and gradle, and is passing in Jenkins. The issue you are seeing suggests that our JDBC driver is not being registered in your environment. This should be automatically done by the service file (META-INF/services/java.sql.Driver). Can you try manually loading the driver at the start of the test? This line should do it:

Class.forName("org.apache.beam.sdk.extensions.sql.impl.JdbcDriver");

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! I think this is the issue. I will load the driver manually and test it again.

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