You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by paul-rogers <gi...@git.apache.org> on 2016/12/02 22:05:03 UTC

[GitHub] drill pull request #676: Drill 5091: JDBC unit test fails to set up test sto...

GitHub user paul-rogers opened a pull request:

    https://github.com/apache/drill/pull/676

    Drill 5091: JDBC unit test fails to set up test storage plugin config on Java 8

    Two parts: hygiene and the bug fixes.
    
    Hygiene just cleans up nuisance compiler warnings seen in Eclipse.
    
    The second commit fixes the actual problems as detailed in DRILL-5091:
    
    * Missing test config parameter
    * Handle new Java 8 JDBC functions

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/paul-rogers/drill DRILL-5091

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/676.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #676
    
----
commit 234fab6bd18fcd2d3930598dd8a58187ae1feb2c
Author: Paul Rogers <pr...@maprtech.com>
Date:   2016-12-02T22:02:03Z

    DRILL-5091: Hygiene
    
    Cleans up compiler warnings seen in Eclipse.

commit 39688202434fb450124a52a3d73c45f0a5c39893
Author: Paul Rogers <pr...@maprtech.com>
Date:   2016-12-02T22:02:31Z

    DRILL-5091: JDBC unit test fails to set up test storage plugin config on Java 8
    
    Fixes the two issues described in DRILL-5091:
    
    * Missing test config parameter
    * Handle new Java 8 JDBC functions

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91421707
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java ---
    @@ -397,10 +419,19 @@ public void testPlainStatementMethodsThrowRight() {
           this.factoryConnection = factoryConnection;
         }
     
    +    @Override
         protected PreparedStatement getJdbcObject() throws SQLException {
           return factoryConnection.prepareStatement("VALUES 1");
         }
     
    +    @Override
    +    protected boolean isOkaySpecialCaseException(Method method,
    +                                                 Throwable cause) {
    +       // New Java 8 method not supported by Avatica
    +
    --- End diff --
    
    remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/drill/pull/676


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill issue #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on the issue:

    https://github.com/apache/drill/pull/676
  
    Opened DRILL-5120 for the JDBC Driver update for JDBC 4.2. Added TODOs as requested. Squashed commits to simplify commit to master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91421638
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcAssert.java ---
    @@ -66,6 +66,11 @@ public static void setFactory(ConnectionFactory factory) {
       public static Properties getDefaultProperties() {
         final Properties properties = new Properties();
         properties.setProperty("drillJDBCUnitTests", "true");
    +
    +    // Must set this to false to ensure that the tests ignore any existing
    +    // plugin configurations stored in /tmp/drill.
    +
    --- End diff --
    
    remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91422697
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java ---
    @@ -368,10 +381,19 @@ public void testConnectionMethodsThrowRight() {
           this.factoryConnection = factoryConnection;
         }
     
    +    @Override
         protected Statement getJdbcObject() throws SQLException {
           return factoryConnection.createStatement();
         }
     
    +    @Override
    +    protected boolean isOkaySpecialCaseException(Method method,
    +                                                 Throwable cause) {
    +       // New Java 8 method not supported by Avatica
    +
    --- End diff --
    
    remove the extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill issue #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on the issue:

    https://github.com/apache/drill/pull/676
  
    +1. Thanks for fixing this and for some more cleanup. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91423240
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2769UnsupportedReportsUseSqlExceptionTest.java ---
    @@ -280,6 +280,10 @@ else if (NullPointerException.class == cause.getClass()
               // code implements them.
               successLinesBuf.append(resultLine);
             }
    +        else if (isOkaySpecialCaseException(method, cause)) {
    +          successLinesBuf.append(resultLine);
    +        }
    +
    --- End diff --
    
    remove extra line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91429339
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/JdbcAssert.java ---
    @@ -66,6 +66,11 @@ public static void setFactory(ConnectionFactory factory) {
       public static Properties getDefaultProperties() {
         final Properties properties = new Properties();
         properties.setProperty("drillJDBCUnitTests", "true");
    +
    +    // Must set this to false to ensure that the tests ignore any existing
    +    // plugin configurations stored in /tmp/drill.
    +
    --- End diff --
    
    I prefer extra lines around comments. Makes the flow less cluttered.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by sudheeshkatkam <gi...@git.apache.org>.
Github user sudheeshkatkam commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91797180
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java ---
    @@ -477,18 +468,32 @@ public void testClosedConnectionMethodsThrowRight() {
         }
     
         @Override
    +    protected boolean isOkayNonthrowingMethod(Method method) {
    +      // Java 8 method
    +      if ("getLargeUpdateCount".equals(method.getName())) {
    +        return true; }
    +      return super.isOkayNonthrowingMethod(method);
    +    }
    +
    +    @Override
         protected boolean isOkaySpecialCaseException(Method method, Throwable cause) {
           final boolean result;
           if (super.isOkaySpecialCaseException(method, cause)) {
             result = true;
           }
    +      else if (   method.getName().equals("executeLargeBatch")
    +               || method.getName().equals("executeLargeUpdate")) {
    +        // New Java 8 methods not implemented in Avatica.
    --- End diff --
    
    Please open a ticket for this, so we make changes once Avatica supports Java 8, add TODOs instead of comments for easy tracking ([example](https://github.com/apache/drill/blob/master/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/FragmentWrapper.java#L103)).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91421952
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java ---
    @@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
         }
     
         @Override
    +    protected boolean isOkayNonthrowingMethod(Method method) {
    +      // Java 8 method
    +      if ( "getLargeUpdateCount".equals(method.getName())) {
    +        return true; }
    --- End diff --
    
    remove extra space after if ( .  
    } in a separate line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91422511
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java ---
    @@ -543,6 +566,14 @@ else if (RuntimeException.class == cause.getClass()
             // Special good-enough case--we had to use RuntimeException for now.
             result = true;
           }
    +      else if (  method.getName().equals("setObject")
    --- End diff --
    
    remove extra space after if


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91426330
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java ---
    @@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
         }
     
         @Override
    +    protected boolean isOkayNonthrowingMethod(Method method) {
    +      // Java 8 method
    +      if ( "getLargeUpdateCount".equals(method.getName())) {
    +        return true; }
    +      return super.isOkayNonthrowingMethod(method);
    +    }
    +
    +    @Override
         protected boolean isOkaySpecialCaseException(Method method, Throwable cause) {
           final boolean result;
           if (super.isOkaySpecialCaseException(method, cause)) {
             result = true;
           }
    +      else if (   method.getName().equals("executeLargeBatch")
    --- End diff --
    
    This one stays... The style in this file was to align the terms in the conditional. Following a pattern established elsewhere in the file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91422118
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java ---
    @@ -477,18 +477,32 @@ public void testClosedConnectionMethodsThrowRight() {
         }
     
         @Override
    +    protected boolean isOkayNonthrowingMethod(Method method) {
    +      // Java 8 method
    +      if ( "getLargeUpdateCount".equals(method.getName())) {
    +        return true; }
    +      return super.isOkayNonthrowingMethod(method);
    +    }
    +
    +    @Override
         protected boolean isOkaySpecialCaseException(Method method, Throwable cause) {
           final boolean result;
           if (super.isOkaySpecialCaseException(method, cause)) {
             result = true;
           }
    +      else if (   method.getName().equals("executeLargeBatch")
    --- End diff --
    
    remove extra space after if. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill issue #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by sudheeshkatkam <gi...@git.apache.org>.
Github user sudheeshkatkam commented on the issue:

    https://github.com/apache/drill/pull/676
  
    +1, pending minor comment


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by ppadma <gi...@git.apache.org>.
Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91422620
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java ---
    @@ -587,6 +618,12 @@ else if (RuntimeException.class == cause.getClass()
             // Special good-enough case--we had to use RuntimeException for now.
             result = true;
           }
    +      else if (SQLFeatureNotSupportedException.class == cause.getClass()
    +          && (   method.getName().equals("updateObject")
    --- End diff --
    
    extra space after ( .   move && to line above. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill issue #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on the issue:

    https://github.com/apache/drill/pull/676
  
    Failure is a Maven transfer failure. How to reset?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] drill pull request #676: DRILL-5091: JDBC unit test fail on Java 8

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/676#discussion_r91426377
  
    --- Diff: exec/jdbc/src/test/java/org/apache/drill/jdbc/test/Drill2489CallsAfterCloseThrowExceptionsTest.java ---
    @@ -543,6 +566,14 @@ else if (RuntimeException.class == cause.getClass()
             // Special good-enough case--we had to use RuntimeException for now.
             result = true;
           }
    +      else if (  method.getName().equals("setObject")
    --- End diff --
    
    Same style issue as earlier.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---