The following built-in collection functions in Apache Hive.
Size(Map<K.V>): Returns the number of elements in the map type.
Example:
SELECT mobile,places_lived,SIZE(mobile), SIZE(places_lived) FROM ExplodeTest2;
Size(Array<T>): Returns the number of elements in the array type.
Example:
SELECT SIZE(mobile), SIZE(places_lived) FROM ExplodeTest2;
map_keys(Map<K.V>)
It returns an unordered array containing the keys of the input map.
map_values(Map<K.V>)
It returns an unordered array containing the values of the input map.
Example:
SELECT stats,map_keys(stats) from explodetest3;
SELECT stats,map_keys(stats),map_values(stats) from explodetest3;
Array_Contains(Array<T>, value)
It returns TRUE if the array contains value.
Sort_Array:
Sorts the input array in ascending order according to the natural ordering of the array elements and returns it.
SELECT mobile, sort_array(mobile), places_lived, sort_array(places_lived) from ExplodeTest2;
a
I truly love your blog.. Pleasant colors & theme.
Did you create this site yourself? Please reply back as I’m
wanting to create my own blog and would love
to learn where you got this from or what the theme is called.
Thanks!
LikeLike