MaxGekk commented on a change in pull request #31979:
URL: https://github.com/apache/spark/pull/31979#discussion_r602838532
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala
##########
@@ -647,6 +668,40 @@ private[hive] trait HiveInspectors {
null
}
}
+ case dt: HiveIntervalDayTimeObjectInspector if dt.preferWritable() =>
+ data: Any => {
+ if (data != null) {
+ val dayTime =
dt.getPrimitiveWritableObject(data).getHiveIntervalDayTime
+ dayTime.getTotalSeconds * DateTimeConstants.NANOS_PER_SECOND +
dayTime.getNanos
Review comment:
Could you explain, please, when the nanoseconds are converted to
microseconds because values of `DayTimeIntervalType` must contain microseconds.
And also by converting to nanos and put it to `Long`, you get the risk of
overflow. Could you write a test in which a day-time interval has
`Long.MaxValue` microseconds.
--
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]