hive - Count and find maximum number in Hadoop using pig -
Text after "
I have a table which is called the sample CDR data and column B in that column one and the person's mobile number Required to be the maximum number of calls made (column A) and also for the number which is called the column B, the most
table structure
needs to find the call called
- 889,578,226 77,382,596
- 889,582,256 77,382,596
- 889 The above table 889578226 is the largest number of outgoing calls and 77382596 is the most commonly called number in this way: 582256 +77363682 9 6
- +7785 9 78214 782,987,522
>
In the honeycomb I need to get it run like
below select calling_a, called_b, COUNT (called_b) from cdr_data group calling_a, called_b ;?
Whether the pig can have a similarent code for the above query
< P> Anas, can you please tell me what is it you are hoping for or something different is different?
input.txt A, 100A, 101A, 101A, 101A, 103B, 200B, 201B, 201C, 300C, 300C, 301D, 400Pagescript : A = Load 'Input' ut 'USING Pistgages (', ') AS (Name: Chara, Phone: Long); B = Group A Bye (name, phone); C = FOREACH B Generated Flaton (Group), as CNT (A); D = Group C $ 0; E = derivatives D {Sort list = CNT DESC by order C; Top = LIMIT Sort List 1; Generate flatten (above); } Dump E; Output: (A, 101,3) (b, 201,2) (c, 300,2) (d, 400,1)
Comments
Post a Comment