2014-02-26 49 views

回答

0

猪脚本会(假设标签是在日志文件中的数据分隔符):

A= load '/home/log.txt' using PigStorage('\t') as (one:chararray,two:chararray,three:chararray,four:chararray); 

STORE A INTO 'hbase://table1' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('P:one,P:two,S:three,S:four'); 
+0

喜 我的字段不是制表符分隔的,我需要写的正则表达式现场提取我怎样才能去做? –

+0

PigStroage(r7.0)API支持使用正则表达式作为分隔符标识符:http://pig.apache.org/docs/r0.7.0/api/org/apache/pig/builtin/PigStorage.html – Jasper

相关问题