You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/08/23 04:38:27 UTC
[GitHub] [spark] dgd-contributor opened a new pull request #33806: [SPARK-36304]{SQL]: Refactor fifteenth set of 20 query execution errors to use error classes
dgd-contributor opened a new pull request #33806:
URL: https://github.com/apache/spark/pull/33806
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'core/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->Adds error classes to some of the exceptions in QueryExecutionErrors.
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->Improves auditing for developers and adds useful fields for users (error class and SQLSTATE).
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->Fills in missing error class and SQLSTATE fields.
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->Existing tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dgd-contributor commented on pull request #33806: [SPARK-36304][SQL] Refactor fifteenth set of 20 query execution errors to use error classes
Posted by GitBox <gi...@apache.org>.
dgd-contributor commented on pull request #33806:
URL: https://github.com/apache/spark/pull/33806#issuecomment-933381694
Thanks for all your suggestions in recent our PRs, @karenfeng. dgd-contributors is a team, so it may be inconvenient for you when you help a member to resolve this problem and other members don't know anything about it. You can see the same problem in another PR so we are sorry about it. Now, a member of dgd team will work on all issues involved in refactoring query execution errors to use error classes. We will close all recent PR and a member will make PRs for those issues, so when you have time, please help us again.
If you get uncomfortable when helping us, we are sorry again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dgd-contributor commented on pull request #33806: [SPARK-36304][SQL] Refactor fifteenth set of 20 query execution errors to use error classes
Posted by GitBox <gi...@apache.org>.
dgd-contributor commented on pull request #33806:
URL: https://github.com/apache/spark/pull/33806#issuecomment-930696981
cc @karenfeng , please help me review it when you have time, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33806: [SPARK-36304]{SQL]: Refactor fifteenth set of 20 query execution errors to use error classes
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33806:
URL: https://github.com/apache/spark/pull/33806#issuecomment-903438236
Can one of the admins verify this patch?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dgd-contributor closed pull request #33806: [SPARK-36304][SQL] Refactor fifteenth set of 20 query execution errors to use error classes
Posted by GitBox <gi...@apache.org>.
dgd-contributor closed pull request #33806:
URL: https://github.com/apache/spark/pull/33806
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] karenfeng commented on a change in pull request #33806: [SPARK-36304][SQL] Refactor fifteenth set of 20 query execution errors to use error classes
Posted by GitBox <gi...@apache.org>.
karenfeng commented on a change in pull request #33806:
URL: https://github.com/apache/spark/pull/33806#discussion_r719688413
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -118,6 +157,18 @@
"message" : [ "PARTITION clause cannot contain a non-partition column name: %s" ],
"sqlState" : "42000"
},
+ "NOT_PUBLIC_CLASS" : {
+ "message" : [ "%s is not a public class. Only public classes are supported." ],
+ "sqlState" : "0A000"
+ },
+ "NOT_USER_DEFINED_TYPE" : {
+ "message" : [ "%s is not an UserDefinedType. Please make sure registering an UserDefinedType for %s" ],
+ "sqlState" : "42000"
+ },
+ "ONLY_SUPPORT_DATA_SOURCES_PROVIDING_FILE_FORMAT" : {
Review comment:
ONLY_SUPPORT_DATA_SOURCES_PROVIDING_FILE_FORMAT -> DATA_SOURCE_DOES_NOT_PROVIDE_FILE_FORMAT
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -110,6 +146,9 @@
"message" : [ "Unknown static partition column: %s" ],
"sqlState" : "42000"
},
+ "MULTI_FAILURES_IN_STAGE_MATERIALIZATION" : {
Review comment:
MULTI -> MULTIPLE
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -46,8 +70,20 @@
"message" : [ "Failed to rename %s to %s as destination already exists" ],
"sqlState" : "22023"
},
- "FAILED_SET_ORIGINAL_PERMISSION_BACK" : {
- "message" : [ "Failed to set original permission %s back to the created path: %s. Exception: %s" ]
+ "FAIL_SET_ORIGINAL_ACL_BACK" : {
+ "message" : [ "Failed to set original ACL %s back to the created path: %s. Exception: %s" ],
+ "sqlState" : "42000"
+ },
+ "FAIL_SET_ORIGINAL_PERMISSION_BACK" : {
+ "message" : [ "Failed to set original permission %s back to the created path: %s. Exception: %s" ],
+ "sqlState" : "42000"
+ },
+ "FIELD_INDEX_ON_ROW_WITHOUT_SCHEMA" : {
+ "message" : [ "fieldIndex on a Row without schema is undefined." ],
+ "sqlState" : "07009"
+ },
+ "GET_PARENT_LOGGER_NOT_IMPLEMENTED" : {
+ "message" : [ "%s.getParentLogger is not yet implemented." ]
Review comment:
sqlState 0A000
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -134,9 +185,17 @@
"message" : [ "The second argument of '%s' function needs to be an integer." ],
"sqlState" : "22023"
},
+ "TIME_ZONE_ID_NOT_SPECIFIED_FOR_TIMESTAMP_TYPE" : {
Review comment:
TIME_ZONE_ID_NOT_SPECIFIED_FOR_TIMESTAMP_TYPE -> TIMESTAMP_TYPE_DOES_NOT_SPECIFY_TIME_ZONE_ID
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -46,8 +70,20 @@
"message" : [ "Failed to rename %s to %s as destination already exists" ],
"sqlState" : "22023"
},
- "FAILED_SET_ORIGINAL_PERMISSION_BACK" : {
- "message" : [ "Failed to set original permission %s back to the created path: %s. Exception: %s" ]
+ "FAIL_SET_ORIGINAL_ACL_BACK" : {
+ "message" : [ "Failed to set original ACL %s back to the created path: %s. Exception: %s" ],
+ "sqlState" : "42000"
+ },
+ "FAIL_SET_ORIGINAL_PERMISSION_BACK" : {
+ "message" : [ "Failed to set original permission %s back to the created path: %s. Exception: %s" ],
+ "sqlState" : "42000"
+ },
+ "FIELD_INDEX_ON_ROW_WITHOUT_SCHEMA" : {
+ "message" : [ "fieldIndex on a Row without schema is undefined." ],
+ "sqlState" : "07009"
+ },
+ "GET_PARENT_LOGGER_NOT_IMPLEMENTED" : {
Review comment:
GET_PARENT_LOGGER_NOT_IMPLEMENTED -> GET_PARENT_LOGGER_UNSUPPORTED
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1526,106 +1526,136 @@ object QueryExecutionErrors {
}
def unsupportedOperationExceptionError(): Throwable = {
- new UnsupportedOperationException
+ new SparkUnsupportedOperationException(
+ errorClass = "UNSUPPORTED_OPERATION",
Review comment:
The lack of error message here is really bad for the user, although this is technically an internal error (we should never call `defaultConcreteType` on `AnyDataType`). When https://github.com/apache/spark/pull/34123 merges, can you use `INTERNAL_ERROR` instead, and provide a meaningful error message? In this case, we should also rename the class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org