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.

Convert Avro schema to free-text using FreeFormTextRecordSetWriter without knowing field names upfront.

Convert Avro schema to free-text using FreeFormTextRecordSetWriter without knowing field names upfront.

New Contributor

I need to create a fixed-width file from data that exists in Hive. I'm using the following NiFi flow: SelectHiveQL --> ConvertRecord.

SelectHiveQL query reads required fields with required width from the Hive store in Avro format. And ConvertRecord converts Avro schema (using AvroReader) to free-text schema (using FreeFormTextRecordSetWriter).

The problem is that FreeFormTextRecordSetWriter requires filling Text property with specific field names. In my case, field names are not available at design time and they do change from case to case.

Here are some possible options I'm exploring, and looking for guidance from the NiFi experts:

1. Use expression (if one exists) to read the full record without giving specific field names in FreeFormTextRecordSetWriter Text property.

2. Create the Text property value dynamically using Avro schema.

3. Another approach to create fixed-width file.

Don't have an account?
Coming from Hortonworks? Activate your account here