crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mac champion (JIRA)" <>
Subject [jira] [Commented] (CRUNCH-564) Add support for using escape character same as open/close quote character
Date Wed, 30 Sep 2015 18:05:06 GMT


mac champion commented on CRUNCH-564:

The entry point into this clump of files is really the CSVInputFormat

I believe this is what consumers use, they don't access any of these other CSV files directly

If I understand correctly, the problem is that when the CSVInputFormater is instantiated,
it has no configuration. Later, configure() is called.
When I wrote the code, it seems as though I was under the assumption that configuration.get(OPTION)
would always return a blank string if OPTION was not set in the Crunch configuration. Now,
it seems like that is not true. I took a look at the Configuration class and found this:
  public String get(String name) {
    String[] names = handleDeprecation(deprecationContext.get(), name);
    String result = null;
    for(String n : names) {
      result = substituteVars(getProps().getProperty(n));
    return result;
I think the behavior has changed, but I don't really feel like looking too deep into handleDeprecation
and substitueVars to figure that out. Honestly, those calls to configuration and the parsing
that follows just should have been more defensive in the first place. 

> Add support for using escape character same as open/close quote character
> -------------------------------------------------------------------------
>                 Key: CRUNCH-564
>                 URL:
>             Project: Crunch
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Muhammad
>            Assignee: Josh Wills
>            Priority: Trivial
>              Labels: csv, csvparser
> As a user I would like to use CSVInputFormat to handle the CSV files following this RFC
> Many developers use Apache StringEscapeUtils.escapeCsv( ) method to escape their CSVs.
The method escapes the CSV following the RFC4180. 
> The CSVLineReader throws exception in such a case. We can enhance the code to support
the CSVs that use escape same as the quote characters.
> I would appreciate a comment, if someone has knowingly rejected the idea due to some
technical limitation or a problem with allowing escape and quote as same characters. By the
way Apache HAWQ seem to get around this issue somehow and reads such CSVs alright.

This message was sent by Atlassian JIRA

View raw message