srielau commented on code in PR #39937:
URL: https://github.com/apache/spark/pull/39937#discussion_r1156578346
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -651,6 +651,58 @@
"Detected an incompatible DataSourceRegister. Please remove the
incompatible library from classpath or upgrade it. Error: <message>"
]
},
+ "INCOMPATIBLE_DATA_TO_TABLE" : {
Review Comment:
FOR maybe?
```suggestion
"INCOMPATIBLE_DATA_FOR_TABLE" : {
```
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -651,6 +651,58 @@
"Detected an incompatible DataSourceRegister. Please remove the
incompatible library from classpath or upgrade it. Error: <message>"
]
},
+ "INCOMPATIBLE_DATA_TO_TABLE" : {
+ "message" : [
+ "Cannot write incompatible data to table <tableName>:"
+ ],
+ "subClass" : {
+ "AMBIGUOUS_COLUMN_NAME" : {
+ "message" : [
+ "Ambiguous column name in the input data: <colPath>."
+ ]
+ },
+ "CANNOT_FIND_DATA" : {
+ "message" : [
+ "Cannot find data for output column <colPath>."
+ ]
+ },
+ "CANNOT_SAFELY_CAST" : {
+ "message" : [
+ "Cannot safely cast <colPath>: <from> to <to>."
+ ]
+ },
+ "EXTRA_STRUCT_FIELDS" : {
+ "message" : [
+ "Cannot write extra fields to struct <colPath>: <extraCols>."
+ ]
+ },
+ "NULLABLE_ARRAY_ELEMENTS" : {
+ "message" : [
+ "Cannot write nullable elements to array of non-nulls: <colPath>."
+ ]
+ },
+ "NULLABLE_COLUMN" : {
+ "message" : [
+ "Cannot write nullable values to non-null column <colPath>."
+ ]
+ },
+ "NULLABLE_MAP_VALUES" : {
+ "message" : [
+ "Cannot write nullable elements to array of non-nulls: <colPath>."
+ ]
+ },
+ "STRUCT_MISSING_FIELDS" : {
+ "message" : [
+ "Struct <colPath> missing fields: <missingFields>."
+ ]
+ },
+ "UNEXPECTED_COLUMN_NAME" : {
+ "message" : [
+ "Struct <colPath> <order>-th field name does not match (may be out
of order): expected <expected>, found <found>."
+ ]
+ }
+ }
Review Comment:
This is all about data source specific errors, right If so let's go with:
```suggestion
},
"sqlState" : "KD000"
```
--
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]