dd.MM.aaaa 与配置单元不兼容 date 输入格式,所以我们需要使用 from_unixtime 以及 unix_timestamp 函数更改格式! Example:hive> select date( --cast to date type from_unixtime( --change the format to yyyy-MM-dd unix_timestamp('09.12.2019','dd.mm.yyyy'), --parse input data 'yyyy-MM-dd') );Result: ``` 2019-01-09
1条答案
按热度按时间uemypmqf1#
dd.MM.aaaa
与配置单元不兼容date
输入格式,所以我们需要使用from_unixtime
以及unix_timestamp
函数更改格式!Example:
hive> select date( --cast to date type from_unixtime( --change the format to yyyy-MM-dd unix_timestamp('09.12.2019','dd.mm.yyyy'), --parse input data 'yyyy-MM-dd') );
Result:
```2019-01-09