MaxGekk commented on a change in pull request #31979:
URL: https://github.com/apache/spark/pull/31979#discussion_r602910875
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala
##########
@@ -1024,6 +1102,24 @@ private[hive] trait HiveInspectors {
new
hiveIo.TimestampWritable(DateTimeUtils.toJavaTimestamp(value.asInstanceOf[Long]))
}
+ private def getDayTimeIntervalWritable(value: Any):
hiveIo.HiveIntervalDayTimeWritable =
+ if (value == null) {
+ null
+ } else {
+ val duration = IntervalUtils.microsToDuration(value.asInstanceOf[Long])
+ new hiveIo.HiveIntervalDayTimeWritable(
+ new HiveIntervalDayTime(duration.getSeconds, duration.getNano))
+ }
+
+ private def getYearMonthIntervalWritable(value: Any):
hiveIo.HiveIntervalYearMonthWritable =
+ if (value == null) {
+ null
+ } else {
+ val period = IntervalUtils.monthsToPeriod(value.asInstanceOf[Int])
+ new hiveIo.HiveIntervalYearMonthWritable(
+ new HiveIntervalYearMonth(period.getYears, period.getMonths))
Review comment:
```suggestion
new hiveIo.HiveIntervalYearMonthWritable(new
HiveIntervalYearMonth(value.asInstanceOf[Int]))
```
--
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]