<bdo id='PJ6a2'></bdo><ul id='PJ6a2'></ul>

  • <legend id='PJ6a2'><style id='PJ6a2'><dir id='PJ6a2'><q id='PJ6a2'></q></dir></style></legend>

    1. <i id='PJ6a2'><tr id='PJ6a2'><dt id='PJ6a2'><q id='PJ6a2'><span id='PJ6a2'><b id='PJ6a2'><form id='PJ6a2'><ins id='PJ6a2'></ins><ul id='PJ6a2'></ul><sub id='PJ6a2'></sub></form><legend id='PJ6a2'></legend><bdo id='PJ6a2'><pre id='PJ6a2'><center id='PJ6a2'></center></pre></bdo></b><th id='PJ6a2'></th></span></q></dt></tr></i><div id='PJ6a2'><tfoot id='PJ6a2'></tfoot><dl id='PJ6a2'><fieldset id='PJ6a2'></fieldset></dl></div>

        <small id='PJ6a2'></small><noframes id='PJ6a2'>

      1. <tfoot id='PJ6a2'></tfoot>

        如何在 Hadoop-.20 api 中指定 KeyValueTextInputFormat 分隔

        时间:2023-09-26

            <i id='txpC2'><tr id='txpC2'><dt id='txpC2'><q id='txpC2'><span id='txpC2'><b id='txpC2'><form id='txpC2'><ins id='txpC2'></ins><ul id='txpC2'></ul><sub id='txpC2'></sub></form><legend id='txpC2'></legend><bdo id='txpC2'><pre id='txpC2'><center id='txpC2'></center></pre></bdo></b><th id='txpC2'></th></span></q></dt></tr></i><div id='txpC2'><tfoot id='txpC2'></tfoot><dl id='txpC2'><fieldset id='txpC2'></fieldset></dl></div>
              <bdo id='txpC2'></bdo><ul id='txpC2'></ul>

              <small id='txpC2'></small><noframes id='txpC2'>

                <legend id='txpC2'><style id='txpC2'><dir id='txpC2'><q id='txpC2'></q></dir></style></legend>
              1. <tfoot id='txpC2'></tfoot>
                  <tbody id='txpC2'></tbody>
                  本文介绍了如何在 Hadoop-.20 api 中指定 KeyValueTextInputFormat 分隔符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  在新 API (apache.hadoop.mapreduce.KeyValueTextInputFormat) 中,如何指定制表符(默认)以外的分隔符(分隔符)来分隔键和值.

                  In new API (apache.hadoop.mapreduce.KeyValueTextInputFormat) , how to specify separator (delimiter) other than tab(which is default) to separate key and Value.

                  示例输入:

                  one,first line
                  two,second line
                  

                  需要输出:

                  Key : one
                  Value : first line
                  Key : two
                  Value : second line
                  

                  我将 KeyValueTextInputFormat 指定为:

                  I am specifying KeyValueTextInputFormat as :

                      Job job = new Job(conf, "Sample");
                  
                      job.setInputFormatClass(KeyValueTextInputFormat.class);
                      KeyValueTextInputFormat.addInputPath(job, new Path("/home/input.txt"));
                  

                  这对于作为分隔符的制表符来说效果很好.

                  This is working fine for tab as a separator.

                  推荐答案

                  在较新的 API 中,您应该使用 mapreduce.input.keyvaluelinerecordreader.key.value.separator 配置属性.

                  In the newer API you should use mapreduce.input.keyvaluelinerecordreader.key.value.separator configuration property.

                  这是一个例子:

                  Configuration conf = new Configuration();
                  conf.set("mapreduce.input.keyvaluelinerecordreader.key.value.separator", ",");
                  
                  Job job = new Job(conf);
                  job.setInputFormatClass(KeyValueTextInputFormat.class);
                  // next job set-up
                  

                  这篇关于如何在 Hadoop-.20 api 中指定 KeyValueTextInputFormat 分隔符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:CombineFileInputFormat Hadoop 0.20.205 的实现 下一篇:Hadoop 1.2.1 - 多节点集群 - Wordcount 程序的减速器阶

                  相关文章

                  最新文章

                • <i id='GaWG8'><tr id='GaWG8'><dt id='GaWG8'><q id='GaWG8'><span id='GaWG8'><b id='GaWG8'><form id='GaWG8'><ins id='GaWG8'></ins><ul id='GaWG8'></ul><sub id='GaWG8'></sub></form><legend id='GaWG8'></legend><bdo id='GaWG8'><pre id='GaWG8'><center id='GaWG8'></center></pre></bdo></b><th id='GaWG8'></th></span></q></dt></tr></i><div id='GaWG8'><tfoot id='GaWG8'></tfoot><dl id='GaWG8'><fieldset id='GaWG8'></fieldset></dl></div>
                    <bdo id='GaWG8'></bdo><ul id='GaWG8'></ul>
                  1. <tfoot id='GaWG8'></tfoot><legend id='GaWG8'><style id='GaWG8'><dir id='GaWG8'><q id='GaWG8'></q></dir></style></legend>

                    <small id='GaWG8'></small><noframes id='GaWG8'>