[ 
https://issues.apache.org/jira/browse/BEAM-4425?focusedWorklogId=106865&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-106865
 ]

ASF GitHub Bot logged work on BEAM-4425:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/May/18 21:39
            Start Date: 29/May/18 21:39
    Worklog Time Spent: 10m 
      Work Description: kennknowles closed pull request #5503: [BEAM-4425] 
Force load JDBC drivers
URL: https://github.com/apache/beam/pull/5503
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriverTest.java
 
b/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriverTest.java
index 59d526fa767..8df4916f3c1 100644
--- 
a/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriverTest.java
+++ 
b/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/JdbcDriverTest.java
@@ -32,11 +32,17 @@
 import org.apache.beam.sdk.extensions.sql.mock.MockedBoundedTable;
 import org.apache.beam.sdk.schemas.Schema.TypeName;
 import org.apache.calcite.jdbc.CalciteConnection;
+import org.junit.Before;
 import org.junit.Test;
 
 /** Test for {@link JdbcDriver}. */
 public class JdbcDriverTest {
 
+  @Before
+  public void before() throws Exception {
+    Class.forName("org.apache.beam.sdk.extensions.sql.impl.JdbcDriver");
+  }
+
   @Test
   public void testDriverManager_getDriver() throws Exception {
     Driver driver = DriverManager.getDriver(JdbcDriver.CONNECT_STRING_PREFIX);
diff --git 
a/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/BeamSqlFnExecutorTestBase.java
 
b/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/BeamSqlFnExecutorTestBase.java
index dbce8db8a2b..1c038995747 100644
--- 
a/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/BeamSqlFnExecutorTestBase.java
+++ 
b/sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/BeamSqlFnExecutorTestBase.java
@@ -84,6 +84,11 @@ public static void prepare() {
             .typeSystem(TYPE_FACTORY.getTypeSystem())
             .build();
 
+    try {
+      Class.forName("org.apache.calcite.jdbc.Driver");
+    } catch (ClassNotFoundException e) {
+      throw new RuntimeException(e);
+    }
     relBuilder = RelBuilder.create(config);
   }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 106865)
    Time Spent: 2h 10m  (was: 2h)

> JDBC driver load errors :jdbc:calcite and :jdbc:beam
> ----------------------------------------------------
>
>                 Key: BEAM-4425
>                 URL: https://issues.apache.org/jira/browse/BEAM-4425
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql
>            Reporter: Kenneth Knowles
>            Assignee: Kenneth Knowles
>            Priority: Major
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> These have different causes but the same fix - force load the JDBC driver 
> before it is used or otherwise factor code so it is not possible to hit this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to