Hive中的数组文字

时间:2014-09-15 04:31:05

标签: hive hiveql

如何在Hive中写出数组文字?

SELECT PERCENTILE(my_column, [0.5, 0.25, 0.50, 0.75, 0.95]) AS quantiles
FROM my_table

返回错误

FAILED: ParseException line xx:xx cannot recognize input near '[' '0.5' ',' in select expression

1 个答案:

答案 0 :(得分:13)

尝试使用array代替[]

SELECT PERCENTILE(my_column, array(0.5, 0.25, 0.50, 0.75, 0.95)) AS quantiles
FROM my_table