Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hadoop 使用mapper将空值写入拼花地板文件_Hadoop_Mapreduce_Parquet - Fatal编程技术网

Hadoop 使用mapper将空值写入拼花地板文件

Hadoop 使用mapper将空值写入拼花地板文件,hadoop,mapreduce,parquet,Hadoop,Mapreduce,Parquet,我正在尝试执行以下操作: String x=null; Group group = factory.newGroup() .append("x", x); context.write(null,group) 使用以下方案: String writeSchema = "message example {\n" + "optional binary x;\n" + "}";<br> String writeSchema=“消息示例{\n”

我正在尝试执行以下操作:

    String x=null;
    Group group = factory.newGroup()
          .append("x", x);
context.write(null,group)

使用以下方案:

String writeSchema = "message example {\n" +
  "optional binary x;\n" +
  "}";<br>
String writeSchema=“消息示例{\n”+
“可选的二进制x;\n”+
"}";

但是我在附加行中得到了NullPointerException。也许我在计划中遗漏了什么

这里的
字符串
对象本身是
null
。在写入文件系统时,它尝试获取导致
NullPointerExeception
的对象的值

String x =null;
System.out.println(x.toString()); // Will cause a NullPointerExeception
类似地,对对象的任何函数调用都会导致相同的错误

尝试改用
String x=“null”