Casting Timestamp to numeric and vice-versa

Casting a Timestamp to a numeric, or a numeric to a Timestamp, is not allowed by default and not supported by the SQL Standard.

Before Upgrade to CDP 7.1.6

In CDP 7.1.5 and earlier, casting to/from Timestamp/numeric was allowed.

After Upgrade to CDP 7.1.6

In CDP 7.1.6, casting to/from Timestamp/numeric is not allowed by default. A new hive.strict.timestamp.conversion property was introduced and set to true by default.

select cast(123 as timestamp);

Output is:

FAILED: SemanticException Line 0:-1 Wrong arguments '123': Casting NUMERIC types to TIMESTAMP is prohibited (hive.strict.timestamp.conversion)

For more information, see HIVE-24157.

Action Required

To use the legacy behavior that allows casting a Timestamp to numeric and vice-versa, set hive.strict.timestamp.conversion to false.