Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

NiFi 1.8.0 CSVReader and CSVRecordSetWriter: How to represent Byte Array data in CSV FlowFile for a field having Avro 'bytes' type in schema registry?

NiFi 1.8.0 CSVReader and CSVRecordSetWriter: How to represent Byte Array data in CSV FlowFile for a field having Avro 'bytes' type in schema registry?

New Contributor

In NiFi 1.8.0, The record field with Avro type: 'bytes' must be represented as a JSON Array ( For E.g. [65,66,67] ) in JSON file. On using ConvertRecord Processor to convert JSON to CSV, the CSVRecordSetWriter writes the bytes field array data as a string like "[65,66,67]" . On passing the output CSV FlowFile to a Processor using CSVReader, It reads the bytes field as a String, and on writing it using a CSVRecordSetWriter, it writes it as "[91, 54, 53, 44, 32, 54, 54, 44, 32, 54, 55, 93]". So how to represent a Byte array in CSV file, so that it would be successfully read as an array by CSV Reader?

Note: I am using Apache Commons CSV parser in CSVReader.