Guangning Yu's Blog
Home
Code
Data
Setup
Industry
MachineLearning
Archive
Hive Basics
2019-02-17 01:40:29
|
Hive
- Date functions ``` -- change date format from_unixtime(unix_timestamp('20150101' ,'yyyyMMdd'), 'yyyy-MM-dd') -- add n days date_add('2015-11-01', 30) -- will return '2015-12-01' -- calculate date difference datediff('2015-12-01', '2015-11-01') -- will return 30 ``` - Generate row number ``` row_number() over (DISTRIBUTE BY... SORT BY... DESC) ``` - Get partition information ``` analyze table xxx.yyy partition(dt = '2015-12-11') compute statistics; describe formated xxx.yyy partition (dt = '2015-12-11'); ```
Previous:
Neural Network
Next:
Calculate the similarity of two vectors