-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-41173][SQL] Move require() out from the constructors of string expressions
#38705
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
Conversation
require() out from the constructors of string expressionsrequire() out from the constructors of string expressions
require() out from the constructors of string expressionsrequire() out from the constructors of string expressions
| -- !query output | ||
| org.apache.spark.sql.AnalysisException | ||
| requirement failed: format_string() should take at least 1 argument; line 1 pos 7 | ||
| 0; line 1 pos 7 |
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.
hmm, why is that? We should see similar error as for select concat_ws().
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.
fixed
|
|
||
| require(children.nonEmpty, s"$prettyName() should take at least 1 argument") | ||
| if (!SQLConf.get.getConf(SQLConf.ALLOW_ZERO_INDEX_IN_FORMAT_STRING)) { | ||
| if (children.nonEmpty && !SQLConf.get.getConf(SQLConf.ALLOW_ZERO_INDEX_IN_FORMAT_STRING)) { |
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.
My mistake, need to add nonEmpty condition
|
+1, LGTM. Merging to master. |
…ng expressions ### What changes were proposed in this pull request? This pr aims to move `require()` out from the constructors of string expressions, include `ConcatWs` and `FormatString`. The args number checking logic moved into `checkInputDataTypes()`. ### Why are the changes needed? Migration onto error classes unifies Spark SQL error messages. ### Does this PR introduce _any_ user-facing change? Yes. The PR changes user-facing error messages. ### How was this patch tested? Pass GitHub Actions Closes apache#38705 from LuciferYang/SPARK-41173. Authored-by: yangjie01 <[email protected]> Signed-off-by: Max Gekk <[email protected]>
…ng expressions ### What changes were proposed in this pull request? This pr aims to move `require()` out from the constructors of string expressions, include `ConcatWs` and `FormatString`. The args number checking logic moved into `checkInputDataTypes()`. ### Why are the changes needed? Migration onto error classes unifies Spark SQL error messages. ### Does this PR introduce _any_ user-facing change? Yes. The PR changes user-facing error messages. ### How was this patch tested? Pass GitHub Actions Closes apache#38705 from LuciferYang/SPARK-41173. Authored-by: yangjie01 <[email protected]> Signed-off-by: Max Gekk <[email protected]>
…ng expressions ### What changes were proposed in this pull request? This pr aims to move `require()` out from the constructors of string expressions, include `ConcatWs` and `FormatString`. The args number checking logic moved into `checkInputDataTypes()`. ### Why are the changes needed? Migration onto error classes unifies Spark SQL error messages. ### Does this PR introduce _any_ user-facing change? Yes. The PR changes user-facing error messages. ### How was this patch tested? Pass GitHub Actions Closes apache#38705 from LuciferYang/SPARK-41173. Authored-by: yangjie01 <[email protected]> Signed-off-by: Max Gekk <[email protected]>
What changes were proposed in this pull request?
This pr aims to move
require()out from the constructors of string expressions, includeConcatWsandFormatString.The args number checking logic moved into
checkInputDataTypes().Why are the changes needed?
Migration onto error classes unifies Spark SQL error messages.
Does this PR introduce any user-facing change?
Yes. The PR changes user-facing error messages.
How was this patch tested?
Pass GitHub Actions