Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> Count empty relation after filtering


+
Marco Brinkmann 2013-05-29, 13:55
Copy link to this message
-
Re: Count empty relation after filtering
Try COUNT_STAR.

-Shahab
On Wed, May 29, 2013 at 9:55 AM, Marco Brinkmann <[EMAIL PROTECTED]>wrote:

> Hi everybody,
>
> I have a rather simple question and scenario, but still I could not find an
> answer in the documention or in other resource:
>
> id, valid
> (1, false)
> (2, false)
>
> records = LOAD 'test.csv' USING PigStorage(',') AS (id:long,
> valid:boolean);
>
> test = FILTER records BY valid == true;
> test_count = FOREACH (GROUP test ALL) GENERATE COUNT(test);
>
> DUMP test_count;
>
>
> I would expect that 'valid_count' nows contains '0'. But the dump is
> completely empty (with 'valid == false' I get '(2)' as expected). I use pig
> 0.11.1.
>
> Could someone point me in the right direction?
>
> Cheers, Marco
>
+
Marco Brinkmann 2013-05-29, 14:13
+
Shahab Yunus 2013-05-29, 14:20
+
Marco Brinkmann 2013-05-29, 15:43
+
Peter Connolly 2013-05-29, 16:23
+
mehmet 2013-05-29, 19:25
+
Marco Brinkmann 2013-05-30, 10:01
+
Tobias Schulze-Heinrichs 2013-12-10, 17:00