euler
euler copied to clipboard
基于Spark的graph_data_parser数据生成问题
Spark的executor用HDFSWriter生成part_x.dat二进制文件,部分part读取报“data error”的错误; 我们排除了数据格式不对可能性(用生成的json文件,单机生成dat文件这种方式是OK的) 现象如下:
- 读取失败的part都是在解析最后若干行出错
- 部分失败的part再一次加载训练的时候,load又不出错
Update: Spark executor的Core改成1,问题就解决了。 是Writer的flush出现问题了吗?
ping @yangsiran
This issue can be fixed by adding hflush
function in HDFSWriter class.
And also, you should call the hflush
function after everything is done.
@pgplus1628 As showed in last post, writer will flush
after every record is written.
@ZunwenYou oh, I mean hflush
.
@pgplus1628 you are right.
@ZunwenYou 这是我的 spark 写 dat 文件的代码,然而写文件的代码好像并没有被执行,请问是什么原因? 求教
@arsenezhang rdd need a action to trigger lazy operation. you have to execute resultRDD.count()
您好,我用spark生成训练数据一直解析有问题,能否劳驾发一份spark生成训练数据的代码给我呢^_^