比较两个关系在Pig拉丁语

68bkxrlz  于 2021-06-21  发布在  Pig
关注(0)|答案(1)|浏览(261)

我如何比较两个大的关系是否包含完全相等的记录。
两个关系可以有很多记录,比如一百万行,每行有500列。如何确认一个关系中的所有记录是否与另一个关系中的记录完全相同。

twh00eeo

twh00eeo1#

试试这个,

1.First load the relation in one alias with only one column say 'a',
2.Found its count(no. of rows)
3.Then load the second relation in another alias with only one column say 'b',
4.Found its count(no. of rows)
5.Join(Inner) the above two relations using columns a and b
6.then count the number of rows in the joined relation
7.compare the first relation count with join relation count or compare the second relation count with join relation count, if it is equal then both relations having same data.

相关问题