Computes hash of a given value
of type dataType
.
Computes hash of a given value
of type dataType
. The caller needs to check the validity
of input value
.
Hive allows input intervals to be defined using units below but the intervals have to be from the same category: - year, month (stored as HiveIntervalYearMonth) - day, hour, minute, second, nanosecond (stored as HiveIntervalDayTime)
Hive allows input intervals to be defined using units below but the intervals have to be from the same category: - year, month (stored as HiveIntervalYearMonth) - day, hour, minute, second, nanosecond (stored as HiveIntervalDayTime)
eg. (INTERVAL '30' YEAR + INTERVAL '-23' DAY) fails in Hive
This method mimics HiveIntervalDayTime.hashCode() in Hive.
Two differences wrt Hive due to how intervals are stored in Spark vs Hive:
- If the INTERVAL
is backed as HiveIntervalYearMonth in Hive, then this method will not
produce Hive compatible result. The reason being Spark's representation of calendar does not
have such categories based on the interval and is unified.
- Spark's CalendarInterval has precision upto microseconds but Hive's HiveIntervalDayTime can store data with precision upto nanoseconds. So, any input intervals with nanosecond values will lead to wrong output hashes (ie. non adherent with Hive output)
Mimics TimestampWritable.hashCode() in Hive