datasalt / splout-db

A web-latency SQL spout for Hadoop.
50 stars 14 forks source link

Can't pass space as separator in SimpleGeneratorCMD #9

Closed pereferrera closed 11 years ago

pereferrera commented 11 years ago

When passing --separator " " the separator string gets trimmed by JCommander:

while (i < args.length && ! commandParsed) {
  String arg = args[i];
  String a = trim(arg);

We should check whether this issue can be solved with this version or JCommander or if it has been solved in another version. Maybe we have to use something different to JCommander.

ivanprado commented 11 years ago

I would open a ticket like that https://github.com/cbeust/jcommander/issues/128 to discuss this problem with JCommander people. They seems very active.

2013/1/16 Pere Ferrera notifications@github.com

When passing --separator " " the separator string gets trimmed by JCommander:

while (i < args.length && ! commandParsed) { String arg = args[i]; String a = trim(arg);

We should check whether this issue can be solved with this version or JCommander or if it has been solved in another version. Maybe we have to use something different to JCommander.

— Reply to this email directly or view it on GitHubhttps://github.com/datasalt/splout-db/issues/9.

Iván de Prado CEO & Co-founder www.datasalt.com

pereferrera commented 11 years ago

The mailing list thread didn't raise a solution so it can be good to look for the bug and report it.

https://groups.google.com/forum/?fromgroups#!topic/jcommander/zuNml_zzwZ4

pereferrera commented 11 years ago

Actually every value is trimmed and it's very unlikely that this will be changed. Instead, what we can do is use a custom CharConverter that detects if the input is empty, in which case the only possible rational input would have been a space, and recover it back.

Fixed in master.