Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1941#discussion_r62019194
  
    --- Diff: 
flink-batch-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCOutputFormat.java
 ---
    @@ -95,32 +95,32 @@ private void establishConnection() throws SQLException, 
ClassNotFoundException {
                }
        }
     
    -   private enum SupportedTypes {
    -           BOOLEAN,
    -           BYTE,
    -           SHORT,
    -           INTEGER,
    -           LONG,
    -           STRING,
    -           FLOAT,
    -           DOUBLE
    -   }
    -
        /**
         * Adds a record to the prepared statement.
         * <p>
         * When this method is called, the output format is guaranteed to be 
opened.
    +    * 
    +    * WARNING: this may fail if the JDBC driver doesn't handle null 
correctly and no column types specified in the SqlRow
         *
         * @param tuple The records to add to the output.
         * @throws IOException Thrown, if the records could not be added due to 
an I/O problem.
         */
        @Override
    -   public void writeRecord(OUT tuple) throws IOException {
    +   public void writeRecord(Row tuple) throws IOException {
                try {
    -                   if (types == null) {
    -                           extractTypes(tuple);
    +                   for (int index = 0; index < tuple.productArity(); 
index++) {
    +                           if(tuple.productElement(index) ==null && 
typesArray != null && typesArray.length > 0) {
    +                                   if(typesArray.length == 
tuple.productArity()) {
    --- End diff --
    
    spaces `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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to