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

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

问题描述

我有一个 ctrlB 作为记录分隔符的文件.我能够通过在 pig 存储中覆盖 LoaderInputFormat 类和 getInputFormat() 方法来读取 pig 中的文件.但是我无法使用 ctrlB 作为记录分隔符存储文件.

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.

推荐答案

读取ctrl+b分隔的记录

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

写入ctrl+b分隔记录-

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

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

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