hadoop中的数据类型及其和java中的数据类型的转换
hadoop中的数据类型
1、hadoop数据类型转换成Java-String类型
.toString();即可
2、Int类型–>IntWritable类型
IntWritable i = new IntWritable();
int p = 3;
i.set§;
3、IntWritable类型–>Int类型
IntWritable s = new IntWritable(6);
int p = s.get();
4、String转换成Text
Text s = new Text();
s.set(“hello world!”);
总结:
hadoop类型转换成java中类型
.get()方法
java中类型转换成hadoop类型
.set()方法
原文地址传送门