Home > other >  Scala bring the results to the HDFS brackets, how take out
Scala bring the results to the HDFS brackets, how take out

Time:02-16

the result is that, to the HDFS is  how to get rid of parentheses, best can explain how to do it, thank you for your bosses

CodePudding user response:

You print the tuples directly to the array it is natural that way, you use println way a print is not finished,

CodePudding user response:

But useless, after printing or brackets, that how purify

CodePudding user response:

reference 1st floor SXJIAKE response:
you print the tuples directly to the array it is natural that way, you use println ways to a print is not finished,


But useless, after printing or brackets, that how purify

CodePudding user response:

Used the command line version, I will be here RDD formatted output to the HDFS scala code is written so:
 rdd3. The map (item=& gt; {
(NullWritable. The get (), the new Text (item) _1 + ", "+ item) _2));
}). SaveAsHadoopFile [TextOutputFormat [NullWritable, Text]] (dir);
dir is the output of HDFS directory,

CodePudding user response:

reference 4 floor SXJIAKE response:
used command line version, I will be here RDD formatted output to the HDFS scala code is written so:
 rdd3. The map (item=& gt; {
(NullWritable. The get (), the new Text (item) _1 + ", "+ item) _2));
}). SaveAsHadoopFile [TextOutputFormat [NullWritable, Text]] (dir);
dir is the output of HDFS directory,


Does not apply to the forehead

CodePudding user response:

To have a great god will stuck in this several days the

CodePudding user response:

Output before the map once it is ok to do not add parentheses
E.g.
The map (x=& gt; Val first=x. _1
Val second=x. _2
Val third=x. _3
Val four=x. _4
First + + second "\ t" + "\ t" + + "\ t" third, four
}). SaveAsTextFile (" HDFS://single: 9000//app/data/result ")
  • Related