[
https://issues.apache.org/jira/browse/HIVE-25950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stamatis Zampetakis updated HIVE-25950:
---------------------------------------
Labels: timestamp (was: )
> unix_timestamp returns NULL for incomplete date
> -----------------------------------------------
>
> Key: HIVE-25950
> URL: https://issues.apache.org/jira/browse/HIVE-25950
> Project: Hive
> Issue Type: Bug
> Components: Clients, UDF
> Affects Versions: 3.1.0
> Reporter: roxxette
> Priority: Minor
> Labels: timestamp
>
> select from_unixtime(unix_timestamp('202202', 'yyyyMM'), 'yyyyMMdd');
> returns 20220201 in HDI3.6(Hive1.2.1)
> returns NULL in HDI4.0(Hive3.1.0)
>
> Turns out Hive 1.2.1 has default value for year(1970), month(01), day(01).
> And Hive 3.1.0 doesn't.
>
> So in Hive 3.1.0 we have to parse a date with all 3 parts(y/m/d), otherwise
> it'll fail.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)