# Java UDFs - LzoPigStorage
package xxxxx;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.InputFormat;
import org.apache.hadoop.mapreduce.OutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.pig.builtin.PigStorage;
import com.hadoop.mapreduce.LzoTextInputFormat;
public class LzoPigStorage extends PigStorage {
private String delimiter = null;
public LzoPigStorage() {
super();
}
public LzoPigStorage(String delimiter) {
super(delimiter);
this.delimiter = delimiter;
}
@Override
public InputFormat<LongWritable, Text> getInputFormat() {
return new LzoTextInputFormat();
}
@Override
public OutputFormat getOutputFormat() {
return new TextOutputFormat();
}
}
// 사용
register 파일명.jar;
A = load 'data_path' using xxx.LzoPigStorage('\t') AS (.....);
'Mining' 카테고리의 다른 글
Data Mining Scrap #1 (0) | 2012.07.24 |
---|---|
직관, 통찰, 지식, 과학. 끄적끄적.. (0) | 2012.05.01 |
Hadoop Lzo 압축 설정 (2) (1) | 2011.07.19 |
Hadoop LZO 압축 설정 (0) | 2011.07.06 |
로그 분석 (0) | 2011.06.09 |