cloud-fan commented on code in PR #49210:
URL: https://github.com/apache/spark/pull/49210#discussion_r1895282243


##########
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:
   I think we should think more about the type coercion system.
   
   By extending `ImplicitCastInputTypes`, the function just defines the 
expected input data types and the type coercion system will add implicit cast 
following the general type coerion rule.
   
   By extending `ExpectsInputTypes`, the function also defines the expected 
input data types but Spark just does type checking, no implicit CAST will be 
added. The function itself should implement how to get values with different 
input data types (can be different from CAST).
   
   @srielau what do you think should be the future of this type coercion system?



-- 
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]

Reply via email to