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

UDF should use setLenient(false) when using SimpleDateFormat for parsing given datestring

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • UDF
    • None

    Description

      If UDF has a date format of "MM/DD/YYYY" and the function supply it the String "9/5/05" the date should not be allowed.
      In most cases, parsing must be non-lenient; the given string must strictly adhere to the parsing format."

      For example,

      select hour('2013-05-111 10:10:1') from src limit 1;
      

      it returns 10.
      the result returned is not what is expected, it should be null;

      SimpleDateFormat is lenient by default.
      so, UDF should use setLenient(false) when using SimpleDateFormat for parsing given datestring except for very specific or intended case

      Attachments

        Issue Links

          Activity

            People

              minwoo Minwoo Kim
              minwoo Minwoo Kim
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: