Support Questions
Find answers, ask questions, and share your expertise

NIFI AvroSchemaRegistry format for date

NIFI AvroSchemaRegistry format for date

New Contributor

Hi,

 

I have a NIFI flow with 2 postgres connections - one for input and another with the output. Both the table that is being populated and the table I'm pulling from have a not null constraint on the column, and the data type is date.

 

My timestamp format is as follows: YYYY-MM-dd (I.E. 2021-03-11)

 

I'm unable to convert my date timestamp (referencing https://avro.apache.org/docs/current/spec.html#Logical+Types)

using {"name":"date","type":{"type":"int","logicalType":"date:}}}

 

-I have updated the executeSQL to use avro logical types. When off or on, the error is the same.

-Based on the documentation, everything seems to point to this being the correct format.

-In postgres, the columns (and data that is being pulled) are all not null. 

 

The error I get is: IllegalTypeConversionException: Could not convern value [2021-02-01] of type java.lang.String to date because the value is not in the expected date format: null for field date

 

Any pointers?