External Hive + Avro table can't handle new line characters

I created an external table in hive with Avro as serde format but I found that if new line characters exist in the data hive returns incorrect results when executing any query that returns that information.

Re: External Hive + Avro table can't handle new line characters

I was having the same problem and Cloudera support responded with this workaround that worked for us:

This JIRA is referenced by HIVE-14044[1] which is currently unresolved but there is a workaround suggested in this JIRA which might alleviate the issue. Can you please re-execute the query after setting either one of the parameters in beeline and see if it helps - set hive.query.result.fileformat = SequenceFile; OR set hive.fetch.task.conversion=more; SELECT * FROM table