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 2019/04/17 07:21:36 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #24342: [SPARK-27438][SQL] Parse strings with timestamps by to_timestamp() in microsecond precision

cloud-fan commented on a change in pull request #24342: [SPARK-27438][SQL] Parse strings with timestamps by to_timestamp() in microsecond precision
URL: https://github.com/apache/spark/pull/24342#discussion_r276109044
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
 ##########
 @@ -395,21 +399,21 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
   }
 
   private[this] def decimalToTimestamp(d: Decimal): Long = {
-    (d.toBigDecimal * MICROS_PER_SECOND).longValue()
+    (d.toBigDecimal * timestampScaleFactor).longValue()
   }
   private[this] def doubleToTimestamp(d: Double): Any = {
-    if (d.isNaN || d.isInfinite) null else (d * MICROS_PER_SECOND).toLong
+    if (d.isNaN || d.isInfinite) null else (d * timestampScaleFactor).toLong
   }
 
   // converting seconds to us
 
 Review comment:
   we should update this comment

----------------------------------------------------------------
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


With regards,
Apache Git Services

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