BELUGA BEHR created HIVE-17998: ---------------------------------- Summary: 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
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)