How to perform a DISTINCT in Pig Latin on a subset of columns?

前端 未结 6 826
广开言路
广开言路 2020-12-30 07:06

I would like to perform a DISTINCT operation on a subset of the columns. The documentation says this is possible with a nested foreach:

You cannot us

6条回答
  •  悲哀的现实
    2020-12-30 07:09

    unique_A = FOREACH (GROUP A BY (a1, a2, a3)) {
        limit_a = LIMIT A 1;
        GENERATE FLATTEN(limit_a) AS (a1,a2,a3,a4);
    };
    

提交回复
热议问题