Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-17998

Use FastDateFormat instead of SimpleDateFormat for TimestampWritable

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Duplicate
    • 2.4.0, 3.0.0
    • None
    • None
    • Patch

    Description

      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.

      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");
              }
            };
      

      Attachments

        1. HIVE-17998.1.patch
          2 kB
          David Mollitor

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            belugabehr David Mollitor Assign to me
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment