Skip to content

Initial support for newlines - #1

Merged
woodrad merged 7 commits into
masterfrom
newlines
Feb 7, 2015
Merged

Initial support for newlines#1
woodrad merged 7 commits into
masterfrom
newlines

Conversation

@woodrad

@woodrad woodrad commented Feb 7, 2015

Copy link
Copy Markdown
Owner

This is a recreation of #24 from csv-serde.

This new code has been tested using Hive versions 0.11.0 through 0.14.0. Note Hive 0.14.0 dependencies do not resolve automatically in maven.

Here is a summary of the changes in this PR.

  • Updated pom to use latest version of opencsv. Before this change version 2.3 from 2011 was being used.
  • Removed extraneous spaces at the end of lines.
  • Replace org.apache.hadoop.hive.serde.Constants and org.apache.hadoop.hive.serde2.SerDe with current equivalents. Both have been deprecated since Hive 0.11.0.
  • Added testDeserializeCustomSeparatorCustomEscape(), which shows using the same escape and quote chars does not result in an exception. (Line 77 of CSVSerdeTest). Removed comments around Line 154 of CSVSerde.

opencsv does an alright job of managing embedded line breaks in csv files (it strips carriage returns and breaks that are not \n), but using the SerDe in master with Hive results in NULLs after every row containing a line break. I've included tests and code that will take \n, \r, and \r\n and output them as , , and respectively. I've singled out these breaks because they're the only ones defined in the csv standard.

woodrad added a commit that referenced this pull request Feb 7, 2015
Add initial support for newlines
@woodrad
woodrad merged commit 09d99ed into master Feb 7, 2015
@woodrad
woodrad deleted the newlines branch February 7, 2015 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant