hadoop - HIVE QL: split column into 2 columns and rank each column -


code

   select c1,c2,c3,c4,c5,c6    table    c5 in ('a', 'b') 

from here, want split column c5 2 columns , rank based on value have c6. 1 column should made of results, , other should b results. have been able rank them using rank() over, have been unable split columns apart. haven't gotten techniques other people have used work me.

select c1,c2,c3,c4,c5,c6, rank() on (partition ... order case when c5='a' 1 case when c5='b' 2 end) rnk; 

i not understand c5 contains exactly. replace conditions when c5='a' in case yours.


Comments