dtenedor commented on code in PR #49237: URL: https://github.com/apache/spark/pull/49237#discussion_r1906096803
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala: ########## @@ -298,8 +281,8 @@ case class Uniform(min: Expression, max: Expression, seedExpression: Expression, cast(min, DoubleType), Multiply( Subtract( - cast(max, DoubleType), - cast(min, DoubleType)), + cast(If(IsNull(max), Literal(null, max.dataType), max), DoubleType), Review Comment: Good point, removed this. ########## sql/core/src/test/resources/sql-tests/inputs/random.sql: ########## @@ -22,21 +22,44 @@ SELECT uniform(0, 1, 0) AS result; SELECT uniform(0, 10, 0) AS result; SELECT uniform(0L, 10L, 0) AS result; SELECT uniform(0, 10L, 0) AS result; +SELECT uniform(0, cast(10 as tinyint), 0) AS result; +SELECT uniform(0, cast(10 as bigint), 0) AS result; Review Comment: Good idea, updated. -- 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