问题描述
对 hive 表执行数值运算
id | 数组 | 价值 |
---|---|---|
一 | [10:20] | 2 |
b | [30:40:50] | 5 |
我想把上面的表格转换成下面的
id | 数组 | 价值 | converted_array |
---|---|---|---|
一 | [10:20] | 2 | [20:40] |
b | [30:40:50] | 5 | [150:200:250] |
我想将“array”列与“value”列相乘,并使用 hql 创建一个新列“converted_array”。我知道如何在 python 中做到这一点,但我想知道是否有办法在 hive 中做到这一点。