LuciferYang commented on code in PR #51351:
URL: https://github.com/apache/spark/pull/51351#discussion_r2182026663


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/util/SparkDateTimeUtils.scala:
##########
@@ -145,42 +145,42 @@ trait SparkDateTimeUtils {
   }
 
   /**
-   * Gets the number of microseconds since midnight using the given time zone.
+   * Gets the number of nanoseconds since midnight using the given time zone.
    */
-  def instantToMicrosOfDay(instant: Instant, timezone: String): Long = {
-    instantToMicrosOfDay(instant, getZoneId(timezone))
+  def instantToNanosOfDay(instant: Instant, timezone: String): Long = {
+    instantToNanosOfDay(instant, getZoneId(timezone))
   }
 
   /**
-   * Gets the number of microseconds since midnight using the given time zone.
+   * Gets the number of nanoseconds since midnight using the given time zone.
    */
-  def instantToMicrosOfDay(instant: Instant, zoneId: ZoneId): Long = {
+  def instantToNanosOfDay(instant: Instant, zoneId: ZoneId): Long = {
     val localDateTime = LocalDateTime.ofInstant(instant, zoneId)
-    localDateTime.toLocalTime.getLong(MICRO_OF_DAY)
+    localDateTime.toLocalTime.getLong(NANO_OF_DAY)
   }
 
   /**
-   * Truncates a time value (in microseconds) to the specified fractional 
precision `p`.
+   * Truncates a time value (in nanoseconds) to the specified fractional 
precision `p`.
    *
    * For example, if `p = 3`, we keep millisecond resolution and discard any 
digits beyond the
-   * thousand-microsecond place. So a value like `123456` microseconds 
(12:34:56.123456) becomes
+   * thousand-nanosecond place. So a value like `123456` microseconds 
(12:34:56.123456) becomes

Review Comment:
   ```
   So a value like `123456` microseconds (12:34:56.123456) becomes
      * `123000` microseconds (12:34:56.123).
   ```
   Is it still "microseconds" in this comment? Is that correct?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to