Skip to main content
dk123
Silver ⭐️
Dec 6, 2019 11:25 AM UTC
Solved

NiFi SchemaParseException: Illegal initial character

Hi All,

when using the MergeContent processor I'm getting an avro.SchemaParseException due to $ characters in a nested attribute name ($.Snapshot.Events.['$values'][0].SportsUrn) in a json file. I have tried to fix it with the UpdateAttribute processor, but it won't work. What would be the best way to handle this exception?

Your support is highly appreciated!

Thanks

image.png

MattWho
MattWhoAnswer
Titanium ⭐️⭐️
Dec 9, 2019 10:00 PM UTC

@dk123 

 

You may want to use the replaceText processor to update your FlowFile's json content.

 

My suggestion would be to replace all occurrences of $ with either \$ or \\$

Hope this helps,

Matt

2 replies

MattWho
Titanium ⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️
Dec 9, 2019 10:00 PM UTC

@dk123 

 

You may want to use the replaceText processor to update your FlowFile's json content.

 

My suggestion would be to replace all occurrences of $ with either \$ or \\$

Hope this helps,

Matt

Translate
dk123
dk123Author
Silver ⭐️
Dec 10, 2019 3:28 PM UTC

Hi Matt, thanks - works fine for me!

Translate