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

    https://github.com/apache/flink/pull/5272#discussion_r168175822
  
    --- Diff: 
flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/batch/connectors/cassandra/CassandraOutputFormat.java
 ---
    @@ -95,15 +94,14 @@ public void writeRecord(OUT record) throws IOException {
                        throw new IOException("write record failed", exception);
                }
     
    -           Object[] fields = new Object[record.getArity()];
    -           for (int i = 0; i < record.getArity(); i++) {
    -                   fields[i] = record.getField(i);
    -           }
    +           Object[] fields = extractFields(record);
                ResultSetFuture result = 
session.executeAsync(prepared.bind(fields));
                Futures.addCallback(result, callback);
        }
     
    -   /**
    +   protected abstract Object[] extractFields(OUT record);
    --- End diff --
    
    Add an `Object[] fields` parameter that can be reused across invocations of 
`extractFields()`.


---

Reply via email to