ITeye博客

hive 内置函数

乡里伢崽 · 2014-08-11 09:06 · hive · 编程语言 · Markdown

1.sort_array(): sort_array(array(obj1, obj2,...)) - Sorts the input array in ascending order according to the natural ordering of the array elements. Example:

SELECT sort_array(array('b', 'd', 'c', 'a')) FROM src LIMIT 1; 'a', 'b', 'c', 'd' 2.ads(): abs(x) - returns the absolute value of x Example: SELECT abs(0) FROM src LIMIT 1; 0 SELECT abs(-5) FROM src LIMIT 1; 5 3,array_contains() array_contains(array, value) - Returns TRUE if the array contains value. Example: SELECT array_contains(array(1, 2, 3), 2) FROM src LIMIT 1; true

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。