gengliangwang commented on a change in pull request #32070:
URL: https://github.com/apache/spark/pull/32070#discussion_r608464102
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
##########
@@ -851,4 +851,36 @@ object IntervalUtils {
}
s"INTERVAL '$sign${absMonths / MONTHS_PER_YEAR}-${absMonths %
MONTHS_PER_YEAR}' YEAR TO MONTH"
}
+
+ /**
+ * Converts a day-time interval as a number of microseconds to its textual
representation
+ * which conforms to the ANSI SQL standard.
+ *
+ * @param micros The number of microseconds, positive or negative
+ * @return Day-time interval string
+ */
+ def toDayTimeIntervalString(micros: Long): String = {
+ var sign = ""
+ var rest = micros
+ if (micros < 0) {
+ if (micros == Long.MinValue) {
Review comment:
nice catch!
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]