hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BELUGA BEHR (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-17998) Use FastDateFormat instead of SimpleDateFormat for TimestampWritable
Date Tue, 07 Nov 2017 16:02:01 GMT

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

BELUGA BEHR updated HIVE-17998:
-------------------------------
    Status: Patch Available  (was: Open)

> 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)

Mime
View raw message