You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "CruiseCheung (Jira)" <ji...@apache.org> on 2021/04/06 13:25:00 UTC
[jira] [Commented] (HIVE-24972) To_date function should compatible
with non-breaking space and full-width space
[ https://issues.apache.org/jira/browse/HIVE-24972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17315553#comment-17315553 ]
CruiseCheung commented on HIVE-24972:
-------------------------------------
Added a patch for this issue. Anybody help to review it?
> To_date function should compatible with non-breaking space and full-width space
> -------------------------------------------------------------------------------
>
> Key: HIVE-24972
> URL: https://issues.apache.org/jira/browse/HIVE-24972
> Project: Hive
> Issue Type: Improvement
> Affects Versions: 3.1.2
> Reporter: CruiseCheung
> Priority: Minor
> Fix For: 4.0.0
>
> Attachments: HIVE-24972.patch
>
>
> Suppose the input string format : "yyyy-MM-dd\u00A0hh:mm:ss",
> select to_date('2021-04-01 01:02:03'),the space is non-breaking space or full-width space, we got result '2021-04-01' on hive 1.2 , got NULL on version after 3.1.2。
> GenericUDFDate:
> (1)hive 1.2 SimpleDateFormat.parse() ,compatibale with non-breaking space and full-width space
> (2) use DateParser.parseDate()->Date.valueOf(),code
> {code:java}
> int idx = s.indexOf(" ");
> {code}
> not compatibale with non-breaking space and full-width space
--
This message was sent by Atlassian Jira
(v8.3.4#803005)