-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-49987][SQL] Fix the error prompt when seedExpression
is non-foldable in randstr
#48490
Conversation
…foldable in `randstr`
@@ -374,7 +374,7 @@ case class RandStr( | |||
var result: TypeCheckResult = TypeCheckResult.TypeCheckSuccess | |||
def requiredType = "INT or SMALLINT" | |||
Seq((length, "length", 0), | |||
(seedExpression, "seedExpression", 1)).foreach { | |||
(seedExpression, "seed", 1)).foreach { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is an id, could you quote it using to toSQLId()
, please at:
"inputName" -> toSQLId(name),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this, let me update Uniform
's name
in this PR as well:
spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala
Line 266 in 861b5e9
"inputName" -> name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for CI.
It seems the failed tests is related:
|
Thanks! |
+1, LGTM. Merging to master. |
What changes were proposed in this pull request?
The pr aims to
error prompt
whenseedExpression
isnon-foldable
inrandstr
.toSQLId
to set the parameter valueinputName
forrandstr
anduniform
ofNON_FOLDABLE_INPUT
.Why are the changes needed?
parameter
name (seedExpression
) in the error message does not match theparameter
name (seed
) seen in docs by the end-user.Does this PR introduce any user-facing change?
Yes, When
seed
isnon-foldable
, the end-user will get a consistent experience in the error prompt.How was this patch tested?
Update existed UT.
Was this patch authored or co-authored using generative AI tooling?
No.