-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-49538][SQL][TESTS] Detect unused error message parameters #48026
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
Changes from 9 commits
77971ff
89c2062
a3699f0
337b2a9
3a3f6e3
ff8aedb
0b25486
05ef7f5
bf00d0d
b24dae2
55af118
bc72974
07df49a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -904,7 +904,7 @@ | |
| }, | ||
| "NON_STRING_TYPE" : { | ||
| "message" : [ | ||
| "all arguments must be strings." | ||
| "all arguments of the function <funcName> must be strings." | ||
| ] | ||
| }, | ||
| "NULL_TYPE" : { | ||
|
|
@@ -4271,7 +4271,8 @@ | |
| }, | ||
| "STREAM_FAILED" : { | ||
| "message" : [ | ||
| "Query [id = <id>, runId = <runId>] terminated with exception: <message>" | ||
| "Query [id = <id>, runId = <runId>, startOffset = <startOffset>, endOffset = <endOffset>] terminated with exception: <message>", | ||
| "<queryDebugString>" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HeartSaVioR Could you look at the changes, please.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be slightly messed up - This class overrides getMessage and handles queryDebugString separately. So it's expected to not have queryDebugString here. What I'm confused is why we have a case where queryDebugString is passed over message parameters, since we have constructors which directly receive queryDebugString.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@HeartSaVioR ok, let me remove it from message parameters and from the error format. How about other 2 unused parameters: private def toDebugString(includeLogicalPlan: Boolean): String = {
val debugString =
s"""|=== Streaming Query ===
|Identifier: $prettyIdString
|Current Committed Offsets: ${getLatestExecutionContext().startOffsets}
|Current Available Offsets: ${getLatestExecutionContext().endOffsets} |
||
| ], | ||
| "sqlState" : "XXKST" | ||
| }, | ||
|
|
@@ -6222,7 +6223,7 @@ | |
| "Detected implicit cartesian product for <joinType> join between logical plans", | ||
| "<leftPlan>", | ||
| "and", | ||
| "rightPlan", | ||
| "<rightPlan>", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The purpose of this PR is to detect mistakes like this. |
||
| "Join condition is missing or trivial.", | ||
| "Either: use the CROSS JOIN syntax to allow cartesian products between these relations, or: enable implicit cartesian products by setting the configuration variable spark.sql.crossJoin.enabled=true." | ||
| ] | ||
|
|
@@ -7827,7 +7828,7 @@ | |
| }, | ||
| "_LEGACY_ERROR_TEMP_3055" : { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: If we're already touching this _LEGACY, could we just name it? (is this an internal error??)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opened the starter task https://issues.apache.org/jira/browse/SPARK-49549 @mitkedb FYI. |
||
| "message" : [ | ||
| "ScalarFunction '<scalarFunc.name>' neither implement magic method nor override 'produceResult'" | ||
| "ScalarFunction <scalarFunc> neither implement magic method nor override 'produceResult'" | ||
|
MaxGekk marked this conversation as resolved.
|
||
| ] | ||
| }, | ||
| "_LEGACY_ERROR_TEMP_3056" : { | ||
|
|
||
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.
Good catch!