将spark中的ORC文件写入hadoop时出错

时间:2018-05-21 12:24:36

标签: apache-spark hadoop orc

我正在一个提供的小型集群上为学校做一个项目(4个节点,1个是namenode和spark master)。我正在进行计算,然后将spark DataFrame写入hadoop作为ORC文件。然后我得到以下错误:

Caused by: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/myfile.orc/_temporary/0/_temporary/attempt_20180521123532_0005_m_000010_3/part-00010-1dd484de-2d33-4a51-8029-737aa957264e-c000.snappy.orc could only be replicated to 0 nodes instead of minReplication (=1). There are 3 datanode(s) running and no node(s) are excluded in this operation.

有点隐藏在堆栈跟踪中:

Suppressed: java.lang.IllegalArgumentException: Column has wrong number of index entries found: 0 expected: 36

总数据集为5000万行。如果我限制为10,000行,它可以毫无问题地工作。

那么是什么导致了这个问题呢?磁盘空间很多。

编辑:

代码:

df.write.format("orc").mode("overwrite").save("hdfs://namenode-server:9000/user/myfile.orc")

编辑2:

或者毕竟是磁盘空间?

Decommission Status : Normal
Configured Capacity: 20082696192 (18.70 GB)
DFS Used: 1665830730 (1.55 GB)
Non DFS Used: 12819447990 (11.94 GB)
DFS Remaining: 4719075328 (4.39 GB)
DFS Used%: 8.29%
DFS Remaining%: 23.50%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Mon May 21 14:31:52 CEST 2018

源文件是1.5 Gb(txt文件格式),并添加了一些数据,然后保存为ORC。也许确实需要超过4.39 GB的空间。

1 个答案:

答案 0 :(得分:0)

最常见的情况是在同一地点,来自不同池或来自不同提交应用程序的并行记录。 例如,您两次提交了申请,或者您以公平的方式使用公平的调度程序池。

相关问题