maropu commented on a change in pull request #25716: [SPARK-29012][SQL] Support 
special timestamp values
URL: https://github.com/apache/spark/pull/25716#discussion_r322506805
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
 ##########
 @@ -848,4 +852,46 @@ object DateTimeUtils {
     val sinceEpoch = BigDecimal(timestamp) / MICROS_PER_SECOND + offset
     new Decimal().set(sinceEpoch, 20, 6)
   }
+
+  def currentTimestamp(): SQLTimestamp = instantToMicros(Instant.now())
+
+  private def today(zoneId: ZoneId): ZonedDateTime = {
+    Instant.now().atZone(zoneId).`with`(LocalTime.MIDNIGHT)
+  }
+
+  private val specialValue = 
"""(EPOCH|NOW|TODAY|TOMORROW|YESTERDAY)\p{Blank}*(.*)""".r
 
 Review comment:
   The description for the supported special values in this pr should be;
   ```
   epoch [zoneid] - 1970-01-01 00:00:00+00 (Unix system time zero)
   today [zoneid] - midnight today.
   yesterday [zoneid] -midnight yesterday
   tomorrow [zoneid] - midnight tomorrow
   now - current query start time.
   ```
   ?

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


With regards,
Apache Git Services

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

Reply via email to