PutDatabaseRecord "bytes" avro data type fails with error "Cannot cast an instance of [Ljava.lang.Object; to type Types.ARRAY"
I am using ExecuteSQL Nifi processor to read from a Postgresql table defined as per below:
CREATE TABLE otherdatatype(
column1 int,
column2 varchar(255),
column3 bytea
);
I get the values of that table successfully, as per below:
column1 : 1
column2 : "hello world"
column3 :
\x4920616d206261636b20616761696e2e2e2e (converted to text "I am back again...")
and the AVRO schema automatically generated by ExecuteSQL Nifi processor is:
{
"type": "record",
"name": "otherdatatype",
"namespace": "any.data",
"fields": [{
"name": "column1",
"type": ["null", "int"]
}, {
"name": "column2",
"type": ["null", "string"]
}, {
"name": "column3",
"type": ["null", "bytes"]
}]
}
Then I try to use PutDatabaseRecord Nifi processor to insert the values already read into another table, as per below:

The AvroReaderInferSchema record reader property is set to an AvroReader controller that is using the embedded Avro Schema:









