cloud-fan commented on code in PR #49210:
URL: https://github.com/apache/spark/pull/49210#discussion_r1908142183
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionHelper.scala:
##########
@@ -400,6 +401,9 @@ abstract class TypeCoercionHelper {
NaNvl(Cast(l, DoubleType), r)
case NaNvl(l, r) if r.dataType == NullType => NaNvl(l, Cast(r,
l.dataType))
+ case r: RandStr if r.length.dataType != IntegerType =>
+ r.copy(length = Cast(r.length, IntegerType))
Review Comment:
not all the implicit cast should be added, let's reuse the existing util
functions:
```
case r: RandStr if r.length.dataType != IntegerType =>
implicitCast(r.length, IntegerType).map { casted =>
r.copy(length = casted)
}.getOrElse(r)
```
--
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]