0

I have a question similar to this but I need reformat my data inside Hadoop or MySQL since rows are more than half a billion. Is there a MySQL code that can create this format?

https://stackoverflow.com/questions/23003508/reshape-table-in-mysql-or-r#= enter image description here

Thanks,

jbest
  • 640
  • 1
  • 10
  • 28

1 Answers1

0

Solve this problem in Impala by manually creating new columns

    create table newtab as select period,case when `date`=2005 then rating else null end as 2005,


                                  case when `date`=2006 then rating else null end as 2006,
                                             .
                                             .
                                             case when `date`=2011 then rating else null end as 2011
   from origtable 
jbest
  • 640
  • 1
  • 10
  • 28