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.

ConvertCSVtoAvro Failed to convert strings with commas,ConvertCSVToAvro failed to convert records.

ConvertCSVtoAvro Failed to convert strings with commas,ConvertCSVToAvro failed to convert records.

New Contributor

Hi, I'm new to this..

I currently have a csv with addresses. And one of the values is "New York, NY" - however the convert to avro processor seems to be having issues with the comma even though it's enclosed with quotation marks.

Any suggestions?

,

I'm running into an issue with commas. If a value is "New York, NY" the converter seems to have issues.

I'm using the default CSV quote character and my csv has city, state enclosed in dbl quotes but if I remove the comma it works fine.

Any suggestions for this case?

4 REPLIES 4

Re: ConvertCSVtoAvro Failed to convert strings with commas,ConvertCSVToAvro failed to convert records.

Contributor

Hi Harry, Check out the post here and see if this doesn't help solve your problem. https://community.hortonworks.com/questions/17996/nifi-applying-an-avro-schema-in-convertcsvtoavro.h...

If you have specified double quotes as the CSV quote character, then the comma delimiter inside the quotes will be ignored. It's unclear from your description what you were expecting vs. what is happening.

Re: ConvertCSVtoAvro Failed to convert strings with commas,ConvertCSVToAvro failed to convert records.

@Ryan Templeton

Comma will be ignored if you escaped it.

Highlighted

Re: ConvertCSVtoAvro Failed to convert strings with commas,ConvertCSVToAvro failed to convert records.

New Contributor

I am using double quotes as my quote character. And it doesn't ignore the comma inside there quotations. If I manually remove the comma the file is converted just fine.

Re: ConvertCSVtoAvro Failed to convert strings with commas,ConvertCSVToAvro failed to convert records.

@Harry Yuen

Test the same using in your string pipe | instead of "

|New York, NY|

With quotes you need to add escape characters. It is easier to deal with pipe.

Let me know.

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