FAQ
Hi All,

I'm having trouble changing the default TextOutputFormatSeparator from a
tab to a comma.

I tried following google's advice and put in my driver:


     @Override
     public int run(String[] args) throws Exception {
         String input, output;
         if (args.length == 2) {
             input = args[0];
             output = args[1];
         } else {
             System.err.println("Usage: ExtractPlay <input> <output>");
             return -1;
         }

* Configuration conf = new Configuration();**
** //conf.set("mapreduce.textoutputformat.separator", ",");**
** conf.set("mapred.textoutputformat.separator", ",");*

         Job job = new Job(getConf());
         ...

but I'm having no luck. Can someone help me figure out what I'm doing
wrong.

Cheers

Stu

--

---
You received this message because you are subscribed to the Google Groups "CDH Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.

Search Discussions

  • Stuart Horsman at Aug 26, 2013 at 11:13 am
    Hi sorry should have added CDH4.3, MRv1...

    On 26 August 2013 21:11, Stuart Horsman wrote:

    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from a
    tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Alejandro Abdelnur at Aug 26, 2013 at 11:14 am
    Stu,

    You should use "mapreduce.output.textoutputformat.separator"

    Thanks.

    On Mon, Aug 26, 2013 at 1:11 PM, Stuart Horsman wrote:

    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from a
    tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Stuart Horsman at Aug 26, 2013 at 11:29 am
    Hey thanks for the tip but I tried both and same result. Tab separated.
      Any other ideas? Is there a special order for configuration and job
    settings?

    On 26 August 2013 21:14, Alejandro Abdelnur wrote:

    Stu,

    You should use "mapreduce.output.textoutputformat.separator"

    Thanks.

    On Mon, Aug 26, 2013 at 1:11 PM, Stuart Horsman wrote:

    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from a
    tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Alejandro Abdelnur at Aug 26, 2013 at 11:31 am
    Stu,

    Could you please check in the JT web ui, in the job.xml of your job, what
    is the value of the "mapreduce.output.textoutputformat.separator" property?

    Thx

    On Mon, Aug 26, 2013 at 1:29 PM, Stuart Horsman wrote:

    Hey thanks for the tip but I tried both and same result. Tab separated.
    Any other ideas? Is there a special order for configuration and job
    settings?

    On 26 August 2013 21:14, Alejandro Abdelnur wrote:

    Stu,

    You should use "mapreduce.output.textoutputformat.separator"

    Thanks.


    On Mon, Aug 26, 2013 at 1:11 PM, Stuart Horsman <stuart.horsman@gmail.com
    wrote:
    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from a
    tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Stuart Horsman at Aug 26, 2013 at 11:40 am
    so just to confirm I've made the correct setting:

    Configuration conf = new Configuration();
    conf.set("mapreduce.output.textoutputformat.separator", ",");
    //conf.set("mapred.output.textoutputformat.separator", ",");
    //conf.set("mapred.textoutputformat.separator", ",");

    however I can't see this setting in the job.xml?

    On 26 August 2013 21:30, Alejandro Abdelnur wrote:

    Stu,

    Could you please check in the JT web ui, in the job.xml of your job, what
    is the value of the "mapreduce.output.textoutputformat.separator" property?

    Thx

    On Mon, Aug 26, 2013 at 1:29 PM, Stuart Horsman wrote:

    Hey thanks for the tip but I tried both and same result. Tab separated.
    Any other ideas? Is there a special order for configuration and job
    settings?

    On 26 August 2013 21:14, Alejandro Abdelnur wrote:

    Stu,

    You should use "mapreduce.output.textoutputformat.separator"

    Thanks.


    On Mon, Aug 26, 2013 at 1:11 PM, Stuart Horsman <
    stuart.horsman@gmail.com> wrote:
    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from
    a tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Alejandro Abdelnur at Aug 26, 2013 at 1:03 pm
    Stu,

    Would you mind sharing the job.xml from the JT web UI?

    Thx

    On Mon, Aug 26, 2013 at 1:40 PM, Stuart Horsman wrote:

    so just to confirm I've made the correct setting:

    Configuration conf = new Configuration();
    conf.set("mapreduce.output.textoutputformat.separator", ",");
    //conf.set("mapred.output.textoutputformat.separator", ",");
    //conf.set("mapred.textoutputformat.separator", ",");

    however I can't see this setting in the job.xml?

    On 26 August 2013 21:30, Alejandro Abdelnur wrote:

    Stu,

    Could you please check in the JT web ui, in the job.xml of your job, what
    is the value of the "mapreduce.output.textoutputformat.separator" property?

    Thx


    On Mon, Aug 26, 2013 at 1:29 PM, Stuart Horsman <stuart.horsman@gmail.com
    wrote:
    Hey thanks for the tip but I tried both and same result. Tab separated.
    Any other ideas? Is there a special order for configuration and job
    settings?

    On 26 August 2013 21:14, Alejandro Abdelnur wrote:

    Stu,

    You should use "mapreduce.output.textoutputformat.separator"

    Thanks.


    On Mon, Aug 26, 2013 at 1:11 PM, Stuart Horsman <
    stuart.horsman@gmail.com> wrote:
    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from
    a tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Stuart Horsman at Aug 26, 2013 at 9:19 pm
    Hey Alejandro,

    Find attached. Thanks for your help.

    Regards

    On 26 August 2013 23:02, Alejandro Abdelnur wrote:

    Stu,

    Would you mind sharing the job.xml from the JT web UI?

    Thx

    On Mon, Aug 26, 2013 at 1:40 PM, Stuart Horsman wrote:

    so just to confirm I've made the correct setting:

    Configuration conf = new Configuration();
    conf.set("mapreduce.output.textoutputformat.separator", ",");
    //conf.set("mapred.output.textoutputformat.separator", ",");
    //conf.set("mapred.textoutputformat.separator", ",");

    however I can't see this setting in the job.xml?

    On 26 August 2013 21:30, Alejandro Abdelnur wrote:

    Stu,

    Could you please check in the JT web ui, in the job.xml of your job,
    what is the value of the "mapreduce.output.textoutputformat.separator"
    property?

    Thx


    On Mon, Aug 26, 2013 at 1:29 PM, Stuart Horsman <
    stuart.horsman@gmail.com> wrote:
    Hey thanks for the tip but I tried both and same result. Tab
    separated. Any other ideas? Is there a special order for configuration
    and job settings?

    On 26 August 2013 21:14, Alejandro Abdelnur wrote:

    Stu,

    You should use "mapreduce.output.textoutputformat.separator"

    Thanks.


    On Mon, Aug 26, 2013 at 1:11 PM, Stuart Horsman <
    stuart.horsman@gmail.com> wrote:
    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator
    from a tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm
    doing wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Sandy Ryza at Aug 26, 2013 at 5:14 pm
    Hi Stu,

    It looks like the configuration object that you're passing into your new
    Job (which is the one returned by getConf()) is not the configuration
    object that you applied the property to.

    -Sandy

    On Mon, Aug 26, 2013 at 4:11 AM, Stuart Horsman wrote:

    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from a
    tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Stuart Horsman at Aug 26, 2013 at 9:25 pm
    Hey Sandy,

    If that's the case, how do I fix it? There must be some glaringly obvious
    error in my driver code then (attached).

    Stu

    On 27 August 2013 03:14, Sandy Ryza wrote:

    Hi Stu,

    It looks like the configuration object that you're passing into your new
    Job (which is the one returned by getConf()) is not the configuration
    object that you applied the property to.

    -Sandy

    On Mon, Aug 26, 2013 at 4:11 AM, Stuart Horsman wrote:

    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from a
    tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Sandy Ryza at Aug 26, 2013 at 9:32 pm
    Configuration conf = new Configuration();
    conf.set("mapreduce.output.textoutputformat.separator", ",");
    Job job = new Job(getConf());

    should instead be:

    Configuration conf = getConf();
    conf.set("mapreduce.output.textoutputformat.separator", ",");
    Job job = new Job(conf);

    On Mon, Aug 26, 2013 at 2:25 PM, Stuart Horsman wrote:

    Hey Sandy,

    If that's the case, how do I fix it? There must be some glaringly obvious
    error in my driver code then (attached).

    Stu

    On 27 August 2013 03:14, Sandy Ryza wrote:

    Hi Stu,

    It looks like the configuration object that you're passing into your new
    Job (which is the one returned by getConf()) is not the configuration
    object that you applied the property to.

    -Sandy


    On Mon, Aug 26, 2013 at 4:11 AM, Stuart Horsman <stuart.horsman@gmail.com
    wrote:
    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from a
    tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Alejandro Abdelnur at Aug 26, 2013 at 9:32 pm
    Sandy was right:

    -------------------------------------------------

      Configuration conf = new Configuration();

      conf.set("mapreduce.output.textoutputformat.separator", ",");

      //conf.set("mapred.output.textoutputformat.separator", ",");

      //conf.set("mapreduce.textoutputformat.separator", ",");

      //conf.set("mapred.textoutputformat.separator", ",");

       Job job = new Job(getConf());

    -------------------------------------------------

    you should do:


    -------------------------------------------------

    Configuration conf = new Configuration(getConf());

      conf.set("mapreduce.output.textoutputformat.separator", ",");

      //conf.set("mapred.output.textoutputformat.separator", ",");

      //conf.set("mapreduce.textoutputformat.separator", ",");

      //conf.set("mapred.textoutputformat.separator", ",");

       Job job = new Job(conf);

    -------------------------------------------------

    thx


    On Mon, Aug 26, 2013 at 11:25 PM, Stuart Horsman
    wrote:
    Hey Sandy,

    If that's the case, how do I fix it? There must be some glaringly obvious
    error in my driver code then (attached).

    Stu

    On 27 August 2013 03:14, Sandy Ryza wrote:

    Hi Stu,

    It looks like the configuration object that you're passing into your new
    Job (which is the one returned by getConf()) is not the configuration
    object that you applied the property to.

    -Sandy


    On Mon, Aug 26, 2013 at 4:11 AM, Stuart Horsman <stuart.horsman@gmail.com
    wrote:
    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from a
    tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --


    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Stuart Horsman at Aug 26, 2013 at 9:46 pm
    Sorry guys that's still doesn't work. I tried both your methods:

    Configuration conf = getConf();
    conf.set("mapreduce.output.textoutputformat.separator", ",");
    Job job = new Job(conf);

    and:

    Configuration conf = new Configuration(getConf());

    conf.set("mapreduce.output.textoutputformat.separator", ",");

    Job job = new Job(conf);

    just copied and pasted and still it's outputting a tab. Any other ideas?

    On 27 August 2013 07:32, Alejandro Abdelnur wrote:

    Sandy was right:

    -------------------------------------------------

    Configuration conf = new Configuration();

    conf.set("mapreduce.output.textoutputformat.separator", ",");

    //conf.set("mapred.output.textoutputformat.separator", ",");

    //conf.set("mapreduce.textoutputformat.separator", ",");

    //conf.set("mapred.textoutputformat.separator", ",");

    Job job = new Job(getConf());

    -------------------------------------------------

    you should do:


    -------------------------------------------------

    Configuration conf = new Configuration(getConf());

    conf.set("mapreduce.output.textoutputformat.separator", ",");

    //conf.set("mapred.output.textoutputformat.separator", ",");

    //conf.set("mapreduce.textoutputformat.separator", ",");

    //conf.set("mapred.textoutputformat.separator", ",");

    Job job = new Job(conf);

    -------------------------------------------------

    thx


    On Mon, Aug 26, 2013 at 11:25 PM, Stuart Horsman <stuart.horsman@gmail.com
    wrote:
    Hey Sandy,

    If that's the case, how do I fix it? There must be some glaringly
    obvious error in my driver code then (attached).

    Stu

    On 27 August 2013 03:14, Sandy Ryza wrote:

    Hi Stu,

    It looks like the configuration object that you're passing into your new
    Job (which is the one returned by getConf()) is not the configuration
    object that you applied the property to.

    -Sandy


    On Mon, Aug 26, 2013 at 4:11 AM, Stuart Horsman <
    stuart.horsman@gmail.com> wrote:
    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from
    a tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --


    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.
  • Stuart Horsman at Aug 27, 2013 at 1:16 am
    after much trial and error, I finally got it to work

    1) I put the configuration into main:

    public static void main(String[] args) throws Exception {

    Configuration conf = new Configuration();
    conf.set("mapred.textoutputformat.separator", ",");
    ExtractPlay driver = new ExtractPlay();
    int exitCode = ToolRunner.run(conf, driver, args);
    System.exit(exitCode);

    }

    }

    2) and then just get the configuration in the driver:

    Configuration conf = getConf();
      Job job = new Job(conf);

    the separator is actually "mapred.textoutputformat.separator".

    Cheers

    Stu

    On 27 August 2013 07:46, Stuart Horsman wrote:

    Sorry guys that's still doesn't work. I tried both your methods:

    Configuration conf = getConf();
    conf.set("mapreduce.output.textoutputformat.separator", ",");
    Job job = new Job(conf);

    and:

    Configuration conf = new Configuration(getConf());

    conf.set("mapreduce.output.textoutputformat.separator", ",");

    Job job = new Job(conf);

    just copied and pasted and still it's outputting a tab. Any other ideas?

    On 27 August 2013 07:32, Alejandro Abdelnur wrote:

    Sandy was right:

    -------------------------------------------------

    Configuration conf = new Configuration();

    conf.set("mapreduce.output.textoutputformat.separator", ",");

    //conf.set("mapred.output.textoutputformat.separator", ",");

    //conf.set("mapreduce.textoutputformat.separator", ",");

    //conf.set("mapred.textoutputformat.separator", ",");

    Job job = new Job(getConf());

    -------------------------------------------------

    you should do:


    -------------------------------------------------

    Configuration conf = new Configuration(getConf());

    conf.set("mapreduce.output.textoutputformat.separator", ",");

    //conf.set("mapred.output.textoutputformat.separator", ",");

    //conf.set("mapreduce.textoutputformat.separator", ",");

    //conf.set("mapred.textoutputformat.separator", ",");

    Job job = new Job(conf);

    -------------------------------------------------

    thx


    On Mon, Aug 26, 2013 at 11:25 PM, Stuart Horsman <
    stuart.horsman@gmail.com> wrote:
    Hey Sandy,

    If that's the case, how do I fix it? There must be some glaringly
    obvious error in my driver code then (attached).

    Stu

    On 27 August 2013 03:14, Sandy Ryza wrote:

    Hi Stu,

    It looks like the configuration object that you're passing into your
    new Job (which is the one returned by getConf()) is not the configuration
    object that you applied the property to.

    -Sandy


    On Mon, Aug 26, 2013 at 4:11 AM, Stuart Horsman <
    stuart.horsman@gmail.com> wrote:
    Hi All,

    I'm having trouble changing the default TextOutputFormatSeparator from
    a tab to a comma.

    I tried following google's advice and put in my driver:


    @Override
    public int run(String[] args) throws Exception {
    String input, output;
    if (args.length == 2) {
    input = args[0];
    output = args[1];
    } else {
    System.err.println("Usage: ExtractPlay <input> <output>");
    return -1;
    }

    * Configuration conf = new Configuration();**
    ** //conf.set("mapreduce.textoutputformat.separator", ",");**
    ** conf.set("mapred.textoutputformat.separator", ",");*

    Job job = new Job(getConf());
    ...

    but I'm having no luck. Can someone help me figure out what I'm doing
    wrong.

    Cheers

    Stu

    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --


    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google
    Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.


    --
    Alejandro

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    --

    ---
    You received this message because you are subscribed to the Google Groups "CDH Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cdh-user+unsubscribe@cloudera.org.
    For more options, visit https://groups.google.com/a/cloudera.org/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcdh-user @
categorieshadoop
postedAug 26, '13 at 11:11a
activeAug 27, '13 at 1:16a
posts14
users3
websitecloudera.com
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase