I have a table data like below and I want to pivot the data with aggregation .
ColumnA ColumnB ColumnC
1 complete Yes
1 complete Yes
2 In progress No
2 In progress No
3 Not yet started initiate
3 Not yet started initiate
Want to Pivot like below
ColumnA Complete In progress Not yet started
1 2 0 0
2 0 2 0
3 0 0 2
Is there anyway that we can achieve this in hive or Impala?
This is how you can do this in spark scala.
and the output
Use
case
withsum
aggregation: