MaxGekk commented on a change in pull request #31855: URL: https://github.com/apache/spark/pull/31855#discussion_r597085852
########## File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralGenerator.scala ########## @@ -164,13 +164,10 @@ object LiteralGenerator { for { i <- Gen.choose(-100, 100) } yield Literal.create(i, IntegerType) lazy val dayTimeIntervalLiteralGen: Gen[Literal] = { - for { - seconds <- Gen.choose( - Duration.ofDays(-106751990).getSeconds, - Duration.ofDays(106751990).getSeconds) - nanoAdjustment <- Gen.choose(-999999000, 999999000) - } yield { - Literal.create(Duration.ofSeconds(seconds, nanoAdjustment), DayTimeIntervalType) + calendarIntervalLiterGen.map { calendarIntervalLiteral => Review comment: This generator is used to test expressions like `random timestamp + random day-time interval`. I have to adjust the generator to have reasonable intervals, and prevent overflows. -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org