dtenedor commented on code in PR #49210:
URL: https://github.com/apache/spark/pull/49210#discussion_r1906077917
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala:
##########
@@ -330,7 +330,8 @@ object Uniform {
group = "string_funcs")
case class RandStr(
length: Expression, override val seedExpression: Expression, hideSeed:
Boolean)
- extends ExpressionWithRandomSeed with BinaryLike[Expression] with
Nondeterministic {
+ extends ExpressionWithRandomSeed with BinaryLike[Expression] with
Nondeterministic
+ with ExpectsInputTypes {
Review Comment:
Good question. As of this commit, I just call `.toInt` or `.intValue` on it.
This performs rounding if the value is out of range [1].
I updated it to use the `Cast` function instead and call `eval` on it to
obey ANSI/non-ANSI semantics.
[1] https://stackoverflow.com/questions/20099470/number-intvalue-rounds
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]