Skip to content

Commit

Permalink
[SPARK-49987][SQL] Fix the error prompt when seedExpression is non-…
Browse files Browse the repository at this point in the history
…foldable in `randstr`
  • Loading branch information
panbingkun committed Oct 16, 2024
1 parent 861b5e9 commit cd8e9db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
case (expr: Expression, name: String, index: Int) =>
if (result == TypeCheckResult.TypeCheckSuccess) {
if (!expr.foldable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ org.apache.spark.sql.catalyst.ExtendedAnalysisException
"sqlState" : "42K09",
"messageParameters" : {
"inputExpr" : "\"col\"",
"inputName" : "seedExpression",
"inputName" : "seed",
"inputType" : "INT or SMALLINT",
"sqlExpr" : "\"randstr(10, col)\""
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ org.apache.spark.sql.catalyst.ExtendedAnalysisException
"sqlState" : "42K09",
"messageParameters" : {
"inputExpr" : "\"col\"",
"inputName" : "seedExpression",
"inputName" : "seed",
"inputType" : "INT or SMALLINT",
"sqlExpr" : "\"randstr(10, col)\""
},
Expand Down

0 comments on commit cd8e9db

Please sign in to comment.