hivesql语法

Hive 语法:

1.coalesce(a,b,c,d,e)求多个字段第一个非null值,若都为null则为null

2.静态分区动态分区插入

  • 静态分区和动态分区创建时一致
  • 静态分区 insert into table partition(pt=xxxxx)在插入时指定分区字段值
  • 动态分区 insert Into table partition(pt) pt由后续select产生

3.get_json_object(data,‘$.owner’)

1
2
3
4
5
6
7
8
9
{
"store": {
"fruit": [{"weight": 8, "type": "apple"}, {"weight": 9, "type": "pear"}],
"bicycle": {"price": 19.95, "color": "red"}
},
"email": "amy@only_for_json_udf_test.net",
"owner": "amy"
}
结果为amy

hivesql语法
http://example.com/2024/12/18/数仓开发/Hive/hivesql语法/
Author
lpy
Posted on
December 18, 2024
Licensed under