从猪的单行输入生成多行输出

Ash*_*ish 3 hadoop apache-pig

我的要求是通过在pig脚本中使用单行输入生成多行输出.有哪些可能的解决方案?

ale*_*pab 7

我的想法是将您的输入线转换为一个袋子,然后将其展平.这可能是2个案例:

阅读文字:

txt = load '/pig_fun/input/text.txt' using TextLoader();
words = foreach txt generate TOKENIZE($0);
pivoted = foreach words generate FLATTEN($0);
dump pivoted;
Run Code Online (Sandbox Code Playgroud)

输入:

My requirement is to generate multiple lines of output by using single line of input in pig scripting.
What are the possible solutions?
Run Code Online (Sandbox Code Playgroud)

OUTPUT:

(My)
(requirement)
(is)
(to)
(generate)
(multiple)
(lines)
(of)
(output)
(by)
(using)
(single)
(line)
(of)
(input)
(in)
(pig)
(scripting.)
(What)
(are)
(the)
(possible)
(solutions?)
Run Code Online (Sandbox Code Playgroud)

读取列然后旋转它们,请参阅Apache Pig的Pivot表