You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "BELUGA BEHR (JIRA)" <ji...@apache.org> on 2017/11/07 16:02:01 UTC

[jira] [Updated] (HIVE-17998) Use FastDateFormat instead of SimpleDateFormat for TimestampWritable

     [ https://issues.apache.org/jira/browse/HIVE-17998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

BELUGA BEHR updated HIVE-17998:
-------------------------------
    Attachment: HIVE-17998.1.patch

> Use FastDateFormat instead of SimpleDateFormat for TimestampWritable
> --------------------------------------------------------------------
>
>                 Key: HIVE-17998
>                 URL: https://issues.apache.org/jira/browse/HIVE-17998
>             Project: Hive
>          Issue Type: Improvement
>          Components: Serializers/Deserializers
>    Affects Versions: 3.0.0, 2.4.0
>            Reporter: BELUGA BEHR
>            Priority: Trivial
>         Attachments: HIVE-17998.1.patch
>
>
> Currently Hive is using this ThreadLocal/SimpleDateFormat setup to work around the thread-safety limitations of SimpleDateFormat.
> Let us simply drink the Apache Commons champagne and use thread-safe {{org.apache.commons.lang.time.FastDateFormat}} instead.
> {code:java|title=org.apache.hadoop.hive.serde2.io.TimestampWritable}
>   private static final ThreadLocal<DateFormat> threadLocalDateFormat =
>       new ThreadLocal<DateFormat>() {
>         @Override
>         protected DateFormat initialValue() {
>           return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
>         }
>       };
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)