cloud-fan commented on code in PR #49237: URL: https://github.com/apache/spark/pull/49237#discussion_r1893574121
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala: ########## @@ -229,16 +232,20 @@ case class Uniform(min: Expression, max: Expression, seedExpression: Expression, if Seq(first, second).forall(integer) => IntegerType case (_, ShortType) | (ShortType, _) if Seq(first, second).forall(integer) => ShortType + case (_, ByteType) | (ByteType, _) + if Seq(first, second).forall(integer) => ByteType case (_, DoubleType) | (DoubleType, _) => DoubleType case (_, FloatType) | (FloatType, _) => FloatType + case (_, d: DecimalType) => d + case (d: DecimalType, _) => d Review Comment: if it's two decimals, shouldn't we pick the wider one instead of preferring the right one? ########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala: ########## @@ -229,16 +232,20 @@ case class Uniform(min: Expression, max: Expression, seedExpression: Expression, if Seq(first, second).forall(integer) => IntegerType case (_, ShortType) | (ShortType, _) if Seq(first, second).forall(integer) => ShortType + case (_, ByteType) | (ByteType, _) + if Seq(first, second).forall(integer) => ByteType case (_, DoubleType) | (DoubleType, _) => DoubleType case (_, FloatType) | (FloatType, _) => FloatType + case (_, d: DecimalType) => d + case (d: DecimalType, _) => d Review Comment: if it's two decimals, shouldn't we pick the wider one instead of preferring the right-side one? -- 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