metamx/java-util — pull request #2 by jeffwong (2012-10-16 01:46:01+00:00)
Title: Validate header

This request is part 1 of 2 of a refactoring.

In BYOB we are no longer able to parse TSVs. BYOB has some logic to make sure that certain characters are not inside inside the header. A TSV header might look like

Time\tValue

The header was treated as one long string (not an array of strings that was split by some delimiter). The \t is on our blacklist and this string would be flagged as an invalid header. What we want to do is this:

First, parse the header according to the ParserSpec, just as we would parse any row. Then the above header would be

[Time, Value]

On this array of strings, we want to apply the logic that makes sure the header fields do not have bad characters.

ParserUtils already has some logic to check that there are no duplicate fields inside a header. It made sense that the logic to check for bad characters should be together with that check. After this has been merged another change needs to be made in BYOB to yank out the header validation logic.