Nifi - Unable to dump the changed date format column to Cassandra (putcassandrarecord) - InvalidQueryException : Expected 4 byte long for date(10)

Author: sanciya

Originally Sourced from:

I have an usecase to dump the data from csv to cassandra. My source CSV data has one date column which is in the format d-MMM-yy.

eg (Sample input date):


I tried changing the date format to yyyy-MM-dd using CSVReader (Record Reader) and CSVWriter (Record Writer) inside updateattribute processor (along with other column data manipulation activity)

CSV Reader properties: - CsvReader

Avro Schema defined inside CSVReader: - avroschema

CSV Writer properties: - csvwriter

Avro Schema defined inside CSVWriter: - avroschema

Output of CSVWriter:


At the final step I have PutCassandraRecord processor, where I defined CSVReader (as Record Reader) with schemaText property as avroschema

But while executing flow, this putcassandrarecord routes to Failure state due to below error - error

Cassandra table structure:

CREATE TABLE date_dump.forecast ( destination_name text,date date,destination int,maximum int,minimum int, PRIMARY KEY (destination_name, date) )

Could anyone help here to fix this issue, to dump the date column into cassandra table.