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.

ConvertRecord to create a generic Avro schema?

Highlighted

ConvertRecord to create a generic Avro schema?

New Contributor

Trying to make a generic template that uses some input variables (as what columns to pull) and then put them into a sql destination table. I have it working.....if it's strings but recently was using my template and pulling in Maximo data (don't get me started).....well it will have INT columns and then have nulls in them which messes up everything. So plan was to convert the incoming Avro schema to an all string element avro schema (which I can do)......but my issue is that within the controller, I have to specify each column name in the AvroRecordSetWriter. Is there a way to say field1 is "Field1" AND copy over the value from the original avro schema index[0] element and put it as Field1 in the new all strings Avro schema?


In the end....I'm trying to convert incoming schema to have ALL strings and to have the schema/flowfile has element names as "field1", "field2", etc.


Thanks in advance!

1 REPLY 1

Re: ConvertRecord to create a generic Avro schema?

Community Manager

The above was originally posted in the Community Help Track. On Wed May 22 03:15:50 UTC 2019, a member of the HCC moderation staff moved it to the Data Ingestion & Streaming track. The Community Help Track is intended for questions about using the HCC site itself.