private String insertBlock(Row row, TableMetadata targetTable, boolean ifNotExists) throws ExecutionException {
Set<String> keys = row.getCells().keySet();
Map<ColumnName, ColumnMetadata> columnsWithMetadata = targetTable.getColumns();
Map<String, ColumnInsertCassandra> columnsMetadata = new HashMap<>();
try {
for (String key : keys) {
ColumnName col =
new ColumnName(targetTable.getName().getCatalogName().getName(),
targetTable.getName().getName(), key);
columnsMetadata.put(key,
new ColumnInsertCassandra(columnsWithMetadata.get(col).getColumnType(),
row.getCell(key).toString(), key));
}
} catch (Exception e) {
throw new ExecutionException("Trying insert data in a not existing column", e);
}
InsertIntoStatement insertStatement =
new InsertIntoStatement(targetTable, columnsMetadata, ifNotExists);
return insertStatement.toString();
}