Support Questions
Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

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!


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.

Bill Brooks, Community Moderator
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.