0
votes

I have a list of values

9, 8, 28, 66, 7

The rank function in pig is giving me a ranked output of - (Desc)

9
8
7
66
28

Expected Output

66
28
9
8
7

It seems like Pig is only considering the first digit?
Thanks!

1

1 Answers

0
votes

I don't know why it's not working in your case. Probably I can help you with more details on your problem. Here is what I did and it's working. here is a sample file a.log.

cat a.log

1

9

8

28

66

7

I wrote these two lines on grunt shell:

grunt >  q = Load '/home/anurag/a.log' USING PigStorage(',') as (a:int);

grunt > C = rank q by a DESC;

now when dump C. Output is

(1,66)

(2,28)

(3,9)

(4,8)

(5,7)

(6,1)

which was expected

P.S: I am using Pig 0.12