You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/28 06:42:27 UTC

[GitHub] [spark] AngersZhuuuu commented on a change in pull request #31979: [SPARK-34879][SQL][test-hive1.2] HiveInspector support DayTimeIntervalType and YearMonthIntervalType

AngersZhuuuu commented on a change in pull request #31979:
URL: https://github.com/apache/spark/pull/31979#discussion_r602840162



##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala
##########
@@ -512,6 +527,12 @@ private[hive] trait HiveInspectors {
         _ => constant
       case poi: VoidObjectInspector =>
         _ => null // always be null for void object inspector
+      case ym: WritableConstantHiveIntervalDayTimeObjectInspector =>
+        val constant = ym.getWritableConstantValue.asInstanceOf[HiveIntervalDayTime]
+        _ => constant.getTotalSeconds * DateTimeConstants.NANOS_PER_MICROS + constant.getNanos

Review comment:
       > I didn't get this. You multiply seconds by 1000 which is milliseconds and add nanoseconds. Which is obviously wrong (btw day-time interval has microsecond precision). Could you fix this and write a test for this piece of code, please.
   
   Ohhh, sorry, I want to write `DateTimeConstants.NANOS_PER_SECOND`




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org