Grokbase Groups Pig user June 2009
In trying to use the Top() function from the piggybank (PIG-732), I
consistently get the error "could not infer matching function".
This happens even when I write a simple script that just goes through the
steps described in the Top() Javadoc.


grunt> register piggybank.jar
grunt> data = load 'top-data.dat' using PigStorage(',') as (grp, data);

-- what is the source data?
grunt> dump data;

-- go through the steps in the Top() Javadoc
grunt> grouped = group data by grp;
grunt> counted = FOREACH grouped GENERATE FLATTEN(group), COUNT(data) as
grunt> regrouped = GROUP counted BY group;

grunt> dump regrouped;

grunt> describe regrouped;
regrouped: {group: bytearray,counted: {group: bytearray,cnt: long}}

-- now, let's try that Top() function

grunt> topres = FOREACH regrouped {
res = org.apache.pig.piggybank.evaluation.util.Top(1,1,counted);
grunt> dump topres;
2009-06-16 07:11:56,867 [main] ERROR -
ERROR 1045: Could not infer the matching function for
org.apache.pig.piggybank.evaluation.util.Top as multiple or none of them
fit. Please use an explicit cast.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupuser @
categoriespig, hadoop
postedJun 16, '09 at 2:20p
activeJun 18, '09 at 8:31p



site design / logo © 2021 Grokbase