-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-40769][CORE][SQL] Migrate type check failures of aggregate expressions onto error classes #38498
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
|
Still in wip, will fix test later |
| "expectedNum" -> " >= 1", | ||
| "actualNum" -> "0", | ||
| "legacyNum" -> "0", | ||
| "legacyConfKey" -> SQLConf.ALLOW_PARAMETERLESS_COUNT.key, |
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.
Please, use toSQLConf() to quote the config.
| "actualNum" -> "0", | ||
| "legacyNum" -> "0", | ||
| "legacyConfKey" -> SQLConf.ALLOW_PARAMETERLESS_COUNT.key, | ||
| "legacyConfValue" -> true.toString |
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.
true should be quoted by "", see error-classes.json. For instance,
| "<message>.<alternative> If necessary set <config> to \"false\" to bypass this error." |
I would add new helper toSQLConfVal() like:
def toSQLConfVal(conf: String): String = {
quoteByDefault(conf)
}
MaxGekk
left a comment
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.
|
GA passed |
|
+1, LGTM. Merging to master. |
…ressions onto error classes ### What changes were proposed in this pull request? This pr aims to replace `TypeCheckFailure` by `DataTypeMismatch` in type checks in the aggregate expressions: - Count - CollectSet - CountMinSketchAgg - HistogramNumeric ### 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#38498 from LuciferYang/SPARK-40769. Authored-by: yangjie01 <[email protected]> Signed-off-by: Max Gekk <[email protected]>
What changes were proposed in this pull request?
This pr aims to replace
TypeCheckFailurebyDataTypeMismatchin type checks in the aggregate expressions: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