猪存储具有自定义行/记录分隔符的文件 [英] Pig Store the file with custom row/record delimiter

查看:77
本文介绍了猪存储具有自定义行/记录分隔符的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ctrlB作为记录分隔符的文件。我能够通过在Pig存储中重写LoaderInputFormat类和getInputFormat()方法来读取猪中的文件。但我无法使用ctrlB作为记录分隔符存储文件。 阅读 ctrl + b strong>分隔记录

  SET textinputformat.record.delimiter'\\\
'
x = LOAD'xyz'使用PigStorage ( '\\\');

ctrl + b 分隔记录 -

 使用PigStorage('\\\')将x存储为'y'; 


I Have a file with a ctrlB as a record delimiter. I was able to read the file in pig by over-writing LoaderInputFormat class and getInputFormat() method in pig storage. But I was not able to store the file with ctrlB as a record delimiter.

解决方案

Read ctrl+b delimited record

SET textinputformat.record.delimiter '\n'
x= LOAD 'xyz' USING PigStorage('\u0002');

Write ctrl+b delimited record-

store x into 'y' using PigStorage('\u0002');

这篇关于猪存储具有自定义行/记录分隔符的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆