Github user gczsjdy commented on a diff in the pull request: https://github.com/apache/spark/pull/20015#discussion_r157680290 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala --- @@ -944,9 +954,16 @@ object DateTimeUtils { date + daysToMonthEnd } - private val TRUNC_TO_YEAR = 1 - private val TRUNC_TO_MONTH = 2 - private val TRUNC_INVALID = -1 + // Visible for testing. + val TRUNC_TO_YEAR = 1 + val TRUNC_TO_MONTH = 2 + val TRUNC_TO_DAY = 3 + val TRUNC_TO_HOUR = 4 + val TRUNC_TO_MINUTE = 5 + val TRUNC_TO_SECOND = 6 + val TRUNC_TO_WEEK = 7 + val TRUNC_TO_QUARTER = 8 + val TRUNC_INVALID = -1 --- End diff -- Can we bring quarter and week forward, maybe to 3 and 4? Then it's more conform to the order of time granularity and max-level design is not influenced.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org