You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/09/01 17:22:28 UTC

[GitHub] [beam] TheNeuralBit commented on a change in pull request #12738: [BEAM-10615] Eliminate nullability errors from :sdks:java:extensions:sql:jdbc

TheNeuralBit commented on a change in pull request #12738:
URL: https://github.com/apache/beam/pull/12738#discussion_r481309457



##########
File path: sdks/java/extensions/sql/jdbc/src/test/java/org/apache/beam/sdk/extensions/sql/jdbc/BeamSqlLineIT.java
##########
@@ -198,12 +202,15 @@ private String taxiRideJSON(
     return objectNode.toString();
   }
 
+  /** Suppressing this due to https://github.com/typetools/checker-framework/issues/979. */
+  @SuppressWarnings("return.type.incompatible")
   private Future<List<List<String>>> runQueryInBackground(String[] args) {
     return pool.submit(
         (Callable)
             () -> {
               ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-              BeamSqlLine.runSqlLine(args, null, outputStream, null);
+              InputStream inputStream = new ByteArrayInputStream(new byte[0]);
+              BeamSqlLine.runSqlLine(args, inputStream, outputStream, null);

Review comment:
       I think actually the appropriate fix here is to make `inputStream` `@Nullable` in runSqlLine. It looks like SqlLine handles a null here: https://github.com/julianhyde/sqlline/blob/sqlline-1.4.0/src/main/java/sqlline/SqlLine.java#L717-L722
   
   Could you try that instead?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org