private String buildSql(Row row) {
        StringBuffer fields = new StringBuffer();
        StringBuffer values = new StringBuffer();
        for (int index = 0; index < row.getArity(); index++) {
            if (row.getField(index) == null) {
            } else {
                fields.append(fieldNames[index] + ",");
                if (row.getField(index) instanceof String
                        || row.getField(index) instanceof Time
                        || row.getField(index) instanceof Date
                        || row.getField(index) instanceof Timestamp) {
                    values.append("'" + row.getField(index) + "'" + ",");
                } else {
                    values.append(row.getField(index) + ",");
                }
            }
        }
        fields.deleteCharAt(fields.length() - 1);
        values.deleteCharAt(values.length() - 1);
        String cql = "INSERT INTO " + database + "." + tableName + " (" + fields.toString() + ") "
                + " VALUES (" + values.toString() + ")";
        return cql;
    }
Adds a record to the prepared statement.
<p>
When this method is called, the output format is guaranteed to be opened.
</p>
<p>
WARNING: this may fail when no column types specified (because a best effort approach is attempted in order to
insert a null value but it's not guaranteed that the JDBC driver handles PreparedStatement.setObject(pos, null))

@param tuple2 The records to add to the output.
@throws IOException Thrown, if the records could not be added due to an I/O problem.
@see PreparedStatement
cassandra/cassandra-sink/src/main/java/com/dtstack/flink/sql/sink/cassandra/CassandraOutputFormat.java