belugabehr edited a comment on pull request #1938: URL: https://github.com/apache/hive/pull/1938#issuecomment-773396681
Before this PR, Hive was not parsing negative dates correctly. Now it has to because the "parse" code has been removed and it now just uses the raw values (which are negative numbers). I changed the formatters to accept negative (and year zero) by changing 'yyyy' (year-of-era) to 'uuuu' (year). https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html I had to update the QTests unfortunately because the 'mask' UDF was assuming that the year 0001 was the first valid year. The function of the 'mask' method is to transform the year (for example) 2021 -> 0000 in order to "mask" it. However, since it did not respect/understand/support year '0000', the year displayed as 0001. This is a bit confusing from a user standpoint. Anyway, Hive should be able to support a year 0000, and these code changes require that it does, so I have updated the qtests to expect a year of value 0000. https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types >The range of values supported for the Date type is 0000-01-01 to 9999-12-31 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
