我们如何在Impala中以下面的格式转换数据。
表格
键|代码|可行的|不可诉
abcd | A | 1 | 3
abcd | A | 2 | 3
abcd | B1 | 0 | 1
abcd | B2 | 5 | 4
abcd | C1 | 0 | 0
abcd | C2 | 1 | 8
ab12 | A | 0 | 7
ab12 | B1 | 1 | 1
ab12 | B2 | 52 | 23
ab12 | C1 | 555 | 777
denormalized table:
键| a_actionable | b1_actionable | b2_actionable | c1_actionable | c2_actionable | a_non-actionable | b1_non-actionable | b2_non-actionable | c1_non诉
abcd | 3 | 0 | 5 | 0 | 1 | 6 | 1 | 4 | 0 | 8
ab12 | 0 | 1 | 52 | 555 | NULL