【发布时间】:2014-07-30 19:47:32
【问题描述】:
我是猪新手。我正在尝试进行合并连接。满足以下要求:
数据必须在连接键上按升序 (ASC) 排序 侧面。
示例文件:
4, The Object of Beauty, 1991,2.8,6150
1, The Nightmare Before Christmas, 1993,3.9,4568
2, The Mummy, 1932,3.5,4388
3, Orphans of the Storm, 1921,3.2,9062
3, Orphans of the Storm, 1921,3.2,9062
4, The Object of Beauty, 1991,2.8,6150
5, Night Tide, 1963,2.8,5126
6, One Magic Christmas, 1985,3.8,5333
7, Muriel's Wedding, 1994,3.5,6323
8, Mother's Boys, 1994,3.4,5733
9, Nosferatu: Original Version, 1929,3.5,5651
10, Nick of Time, 1995,3.4,5333
我在 PIG 中执行了以下命令:
movies = LOAD 'Sample.csv' using PigStorage (',') as (id: int, name, year, rating, duration);
movies_sorted movies = order by id ASC PARALLEL 3;
movies_sorted store into 'output_movies';
当我执行时:
hadoop fs-cat ./output2/part-r-00000
我看到了,在不同的分区中有相同键的记录。例如,我在两个不同的分区中有 id 为 3 的记录。据我所知,具有相同键的记录应始终位于同一分区中。 F
可能出了什么问题?
【问题讨论】:
标签: hadoop mapreduce apache-pig