我的想法是将您的输入线转换为一个袋子,然后将其展平.这可能是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表
| 归档时间: |
|
| 查看次数: |
2041 次 |
| 最近记录: |