hive函数之~复杂类型长度统计函数

1.Map类型长度函数: size(Map<k .V>)

语法: size(Map<k .V>)
返回值: int
说明: 返回map类型的长度

hive> select size(t) from map_table2;

2

2.array类型长度函数: size(Array<T>)

语法: size(Array<T>)
返回值: int
说明: 返回array类型的长度

hive> select size(t) from arr_table2;

4

3.类型转换函数  ***

类型转换函数: cast
语法: cast(expr as <type>)
返回值: Expected "=" to follow "type"
说明: 返回转换后的数据类型

hive> select cast('1' as bigint) from tableName;

1

posted @ 2020-07-05 19:12  小码农成长记  阅读(1393)  评论(0编辑  收藏  举报