3
我的要求是通过在猪脚本中使用单行输入生成多行输出。什么是可能的解决方案?从猪的单线输入生成多行输出
我的要求是通过在猪脚本中使用单行输入生成多行输出。什么是可能的解决方案?从猪的单线输入生成多行输出
这个想法是将你的输入行转换成一个袋子,然后将其压扁。这可能是两种情况:
阅读文本:
txt = load '/pig_fun/input/text.txt' using TextLoader();
words = foreach txt generate TOKENIZE($0);
pivoted = foreach words generate FLATTEN($0);
dump pivoted;
输入:
My requirement is to generate multiple lines of output by using single line of input in pig scripting.
What are the possible solutions?
OUTPUT:
(My)
(requirement)
(is)
(to)
(generate)
(multiple)
(lines)
(of)
(output)
(by)
(using)
(single)
(line)
(of)
(input)
(in)
(pig)
(scripting.)
(What)
(are)
(the)
(possible)
(solutions?)
阅读列,然后旋转他们看到Pivot table with Apache Pig
一个解决方案是我应该使用UDF或PIG的流式传输功能来执行此操作。 – Ashish