New property to control datetime formatter
Learn about the new property that is introduced that allows you to choose the datetime formatter class to be used for formatting and parsing date and timestamp.
Before Upgrade to 7.1.7 SP2 Cumulative hotfix 14
from_unixtime functions were
previously enhanced to use the
DateTimeFormatter class for formatting and
parsing date and timestamp instead of the
After Upgrade to 7.1.7 SP2 Cumulative hotfix 14
HIVE-25576 introduces a configurable
that you can use to choose between
DateTimeFormatter for the
from_unixtime SQL functions.
The two Java datetime formatters differ in their behavior, which leads to different query
results. The supported patterns between the two formatters are also different, which makes
existing queries crash during runtime (after an upgrade). Also, adapting to the new behavior of
DateTimeFormatter class can be challenging and time-consuming for users
considering that the unixtime functions are extensively used.
DateTimeFormatter class is an improvement over
SimpleDateFormat, some users may want to retain the old behavior to
ensure compatibility after migration, therefore, making it necessary for introducing
The possible values for the
hive.datetime.formatter property are 'DATETIME' and 'SIMPLE'
respectively. The default value is set to 'DATETIME'.
hive.datetime.formatter parameter to 'SIMPLE' if you want to use the
SimpleDateFormat class. Add this parameter in Cloudera Manager (Hive Service
Advanced Configuration Snippet (Safety Valve) for hive-site.xml).