MaxGekk commented on code in PR #50296: URL: https://github.com/apache/spark/pull/50296#discussion_r2005021763
########## sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/TimeExpressionsSuite.scala: ########## @@ -51,4 +51,37 @@ class TimeExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { condition = "CANNOT_PARSE_TIME", parameters = Map("input" -> "'100:50'", "format" -> "'mm:HH'")) } + + test("Minute with TIME type") { + // A few test times in microseconds since midnight: + // (time in microseconds, expected minute) + val testTimes = Seq( + (localTime(), 0), // 00:00:00 => 0 + (localTime(12, 58, 59), 58), // 12:58:59 => 58 + (localTime(0, 59), 59), // 00:59:00 => 59 + (localTime(23, 0, 1), 0), // 23:00:01 => 0 + (localTime(1), 0), // 01:00:00 => 0 + (localTime(14, 30), 30), // 14:30:00 => 30 + (localTime(23, 59, 59, 999999), 59) // 23:59:59.999999 => 59 Review Comment: The comments look useless. Just do that in the code: ```suggestion localTime(23, 59, 59, 999999) -> 59 ``` -- 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