karenfeng commented on a change in pull request #33805:
URL: https://github.com/apache/spark/pull/33805#discussion_r717197730
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -1,4 +1,8 @@
{
+ "ALTER_TABLE_WITH_DROP_PARTITION_AND_PURGE_UNSUPPORTED" : {
+ "message" : [ "ALTER TABLE ... DROP PARTITION ... PURGE" ],
+ "sqlState" : "42000"
Review comment:
0A000 may be a better fit for these unsupported-type errors
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -14,13 +18,25 @@
"CANNOT_EVALUATE_EXPRESSION" : {
"message" : [ "Cannot evaluate expression: %s" ]
},
+ "CANNOT_FETCH_TABLES_OF_DATABASE" : {
Review comment:
We can simplify this: `CANNOT_FETCH_TABLES_OF_DATABASE` -> `CANNOT_FETCH
DATABASE_TABLES`
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -14,13 +18,25 @@
"CANNOT_EVALUATE_EXPRESSION" : {
"message" : [ "Cannot evaluate expression: %s" ]
},
+ "CANNOT_FETCH_TABLES_OF_DATABASE" : {
+ "message" : [ "Unable to fetch tables of db %s" ],
+ "sqlState" : "42000"
Review comment:
This seems to be a catch-all type exception. I wouldn't group this as a
syntax/semantic error (42000); maybe we can leave the SQLSTATE field empty.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -92,6 +131,17 @@
"INVALID_JSON_SCHEMA_MAPTYPE" : {
"message" : [ "Input schema %s can only contain StringType as a key type
for a MapType." ]
},
+ "INVALID_PARTITION_FILTER" : {
+ "message" : [ "Partition filter cannot have both `\"` and `\\'`
characters" ],
+ "sqlState" : "42000"
+ },
+ "LEGACY_METADATA_PATH_EXISTS" : {
+ "message" : [ "Error: we detected a possible problem with the location of
your \"_spark_metadata\" directory and you likely need to move it before
restarting this query.", "Earlier version of Spark incorrectly escaped paths
when writing out the \"_spark_metadata\" directory for structured streaming.",
"While this was corrected in Spark 3.0, it appears that your query was started
using an earlier version that incorrectly handled the \"_spark_metadata\"
path.", "Correct \"_spark_metadata\" Directory: %s. Incorrect
\"_spark_metadata\" Directory: %s", "Please move the data from the incorrect
directory to the correct one, delete the incorrect directory, and then restart
this query.", "If you believe you are receiving this message in error, you can
disable it with the SQL conf %s." ]
+ },
+ "LOAD_HIVE_CLIENT_CAUSES_NO_CLASS_DEF_FOUND" : {
Review comment:
DEF -> DEFINITION
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -31,10 +47,18 @@
"CONCURRENT_QUERY" : {
"message" : [ "Another instance of this query was just started by a
concurrent session." ]
},
+ "CONVERT_HIVE_TABLE_TO_CATALOG_TABLE" : {
Review comment:
CONVERT_HIVE_TABLE_TO_CATALOG_TABLE does not capture the error here;
CANNOT_CONVERT_HIVE_TABLE_TO_CATALOG_TABLE would better encompass it
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -46,9 +70,20 @@
"message" : [ "Failed to rename %s to %s as destination already exists" ],
"sqlState" : "22023"
},
+ "FAILED_RENAME_TEMP_FILE" : {
Review comment:
TEMP -> TEMPORARY
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -31,10 +47,18 @@
"CONCURRENT_QUERY" : {
"message" : [ "Another instance of this query was just started by a
concurrent session." ]
},
+ "CONVERT_HIVE_TABLE_TO_CATALOG_TABLE" : {
+ "message" : [ "%s, db: %s, table: %s" ],
+ "sqlState" : "0A000"
Review comment:
This isn't an unsupported operation issue; I'd leave this empty
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -149,6 +214,9 @@
"message" : [ "Unsupported data type %s" ],
"sqlState" : "0A000"
},
+ "UNSUPPORTED_HIVE_METASTORE_VERSION" : {
+ "message" : [ "Unsupported Hive Metastore version (%s). Please set %s with
a valid version." ]
Review comment:
I think this is a 0A000 SQLSTATE.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -92,6 +131,17 @@
"INVALID_JSON_SCHEMA_MAPTYPE" : {
"message" : [ "Input schema %s can only contain StringType as a key type
for a MapType." ]
},
+ "INVALID_PARTITION_FILTER" : {
+ "message" : [ "Partition filter cannot have both `\"` and `\\'`
characters" ],
+ "sqlState" : "42000"
+ },
+ "LEGACY_METADATA_PATH_EXISTS" : {
+ "message" : [ "Error: we detected a possible problem with the location of
your \"_spark_metadata\" directory and you likely need to move it before
restarting this query.", "Earlier version of Spark incorrectly escaped paths
when writing out the \"_spark_metadata\" directory for structured streaming.",
"While this was corrected in Spark 3.0, it appears that your query was started
using an earlier version that incorrectly handled the \"_spark_metadata\"
path.", "Correct \"_spark_metadata\" Directory: %s. Incorrect
\"_spark_metadata\" Directory: %s", "Please move the data from the incorrect
directory to the correct one, delete the incorrect directory, and then restart
this query.", "If you believe you are receiving this message in error, you can
disable it with the SQL conf %s." ]
+ },
+ "LOAD_HIVE_CLIENT_CAUSES_NO_CLASS_DEF_FOUND" : {
+ "message" : [ "%s when creating Hive client using classpath: %s", "Please
make sure that jars for your version of hive and hadoop are included in the
paths passed to %s." ],
+ "sqlState" : "42000"
Review comment:
I'm not sure if this is syntax/semantic error either. I'd remove this.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -118,10 +168,18 @@
"message" : [ "PARTITION clause cannot contain a non-partition column
name: %s" ],
"sqlState" : "42000"
},
+ "PARTITION_COLUMN_NOT_FOUND_IN_SCHEMA" : {
Review comment:
Rename to match `MISSING_COLUMN`: `MISSING_PARTITION_COLUMN`
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -46,9 +70,20 @@
"message" : [ "Failed to rename %s to %s as destination already exists" ],
"sqlState" : "22023"
},
+ "FAILED_RENAME_TEMP_FILE" : {
+ "message" : [ "Failed to rename temp file %s to %s as rename returned
false" ],
+ "sqlState" : "42000"
Review comment:
This isn't necessarily a syntax error. I don't have a good idea for
which SQLSTATE this should be though. I'd leave this empty.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]