[
https://issues.apache.org/jira/browse/HIVE-4594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Minwoo Kim updated HIVE-4594:
-----------------------------
Description:
If UDF has a date format of "MM/DD/YYYY" and the function supply it the String
"9/5/05" the date should *not* be allowed.
In most cases, parsing must be non-lenient; the given string must strictly
adhere to the parsing format."
For example,
{code}
select hour('2013-05-111 10:10:1') from src limit 1;
{code}
it returns 10.
the result returned is not what is expected, it should be null;
SimpleDateFormat is lenient by default.
so, UDF should use setLenient(false) when using SimpleDateFormat for parsing
given datestring except for very specific or intended case
was:
If UDF has a date format of "MM/DD/YYYY" and the function supply it the String
"9/5/05" the date should *not* be allowed.
In all cases, parsing must be non-lenient; the given string must strictly
adhere to the parsing format."
For example,
{code}
select hour('2013-05-111 10:10:1') from src limit 1;
{code}
it returns 10.
the result returned is not what is expected, it should be null;
SimpleDateFormat is lenient by default.
so, UDF should use setLenient(false) when using SimpleDateFormat for parsing
given datestring except for very specific or intended case
> UDF should use setLenient(false) when using SimpleDateFormat for parsing
> given datestring
> -----------------------------------------------------------------------------------------
>
> Key: HIVE-4594
> URL: https://issues.apache.org/jira/browse/HIVE-4594
> Project: Hive
> Issue Type: Bug
> Components: UDF
> Reporter: Minwoo Kim
> Priority: Minor
>
> If UDF has a date format of "MM/DD/YYYY" and the function supply it the
> String "9/5/05" the date should *not* be allowed.
> In most cases, parsing must be non-lenient; the given string must strictly
> adhere to the parsing format."
> For example,
> {code}
> select hour('2013-05-111 10:10:1') from src limit 1;
> {code}
> it returns 10.
> the result returned is not what is expected, it should be null;
> SimpleDateFormat is lenient by default.
> so, UDF should use setLenient(false) when using SimpleDateFormat for parsing
> given datestring except for very specific or intended case
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira