cashmand commented on code in PR #50270:
URL: https://github.com/apache/spark/pull/50270#discussion_r1999701158


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/SparkDateTimeUtils.scala:
##########
@@ -116,6 +116,16 @@ trait SparkDateTimeUtils {
     Instant.ofEpochSecond(secs, mos * NANOS_PER_MICROS)
   }
 
+  /**
+   * Obtains an instance of `java.time.Instant` using nanoseconds from the 
epoch of 1970-01-01
+   * 00:00:00Z.
+   */
+  def nanosToInstant(nanos: Long): Instant = {

Review Comment:
   As far as I can tell, they produce identical results. I just copied the 
locally similar code for microseconds. `Instant.ofEpochSecond` feels a bit more 
idiomatic, if we want to change the Variant version.



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

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to