You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/07/11 14:58:33 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #39937: [SPARK-42309][SQL] Introduce `INCOMPATIBLE_DATA_TO_TABLE` and sub classes.

MaxGekk commented on code in PR #39937:
URL: https://github.com/apache/spark/pull/39937#discussion_r1259851206


##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -3970,10 +4023,18 @@
       "Cannot resolve column name \"<colName>\" among (<fieldNames>)."
     ]
   },
-  "_LEGACY_ERROR_TEMP_1204" : {
+  "_LEGACY_ERROR_TEMP_1202" : {
     "message" : [
-      "Cannot write incompatible data to table '<tableName>':",
-      "- <errors>."
+      "Cannot write to '<tableName>', too many data columns:",
+      "Table columns: <tableColumns>.",
+      "Data columns: <dataColumns>."
+    ]
+  },
+  "_LEGACY_ERROR_TEMP_1203" : {

Review Comment:
   ditto: If it is not used, please, remove it.



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -840,6 +840,59 @@
       "Detected an incompatible DataSourceRegister. Please remove the incompatible library from classpath or upgrade it. Error: <message>"
     ]
   },
+  "INCOMPATIBLE_DATA_FOR_TABLE" : {
+    "message" : [
+      "Cannot write incompatible data for table <tableName>:"

Review Comment:
   ```suggestion
         "Cannot write incompatible data to the table <tableName>."
   ```



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -3970,10 +4023,18 @@
       "Cannot resolve column name \"<colName>\" among (<fieldNames>)."
     ]
   },
-  "_LEGACY_ERROR_TEMP_1204" : {
+  "_LEGACY_ERROR_TEMP_1202" : {

Review Comment:
   Where is it used?



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -840,6 +840,59 @@
       "Detected an incompatible DataSourceRegister. Please remove the incompatible library from classpath or upgrade it. Error: <message>"
     ]
   },
+  "INCOMPATIBLE_DATA_FOR_TABLE" : {
+    "message" : [
+      "Cannot write incompatible data for 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>."

Review Comment:
   ```suggestion
             "Cannot safely cast <colPath> from <srcType> to <targetType>."
   ```



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -840,6 +840,59 @@
       "Detected an incompatible DataSourceRegister. Please remove the incompatible library from classpath or upgrade it. Error: <message>"
     ]
   },
+  "INCOMPATIBLE_DATA_FOR_TABLE" : {
+    "message" : [
+      "Cannot write incompatible data for 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>."

Review Comment:
   ```suggestion
             "Cannot write extra fields <extraFields> to the struct <colPath>."
   ```



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -840,6 +840,59 @@
       "Detected an incompatible DataSourceRegister. Please remove the incompatible library from classpath or upgrade it. Error: <message>"
     ]
   },
+  "INCOMPATIBLE_DATA_FOR_TABLE" : {
+    "message" : [
+      "Cannot write incompatible data for table <tableName>:"
+    ],
+    "subClass" : {
+      "AMBIGUOUS_COLUMN_NAME" : {
+        "message" : [
+          "Ambiguous column name in the input data: <colPath>."

Review Comment:
   ```suggestion
             "Ambiguous column name in the input data <colPath>."
   ```



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -840,6 +840,59 @@
       "Detected an incompatible DataSourceRegister. Please remove the incompatible library from classpath or upgrade it. Error: <message>"
     ]
   },
+  "INCOMPATIBLE_DATA_FOR_TABLE" : {
+    "message" : [
+      "Cannot write incompatible data for table <tableName>:"
+    ],
+    "subClass" : {
+      "AMBIGUOUS_COLUMN_NAME" : {
+        "message" : [
+          "Ambiguous column name in the input data: <colPath>."

Review Comment:
   BTW, why do you use the term `path` instead of `name`. Let's be consistent and use `colName` (see other error classes).



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -840,6 +840,59 @@
       "Detected an incompatible DataSourceRegister. Please remove the incompatible library from classpath or upgrade it. Error: <message>"
     ]
   },
+  "INCOMPATIBLE_DATA_FOR_TABLE" : {
+    "message" : [
+      "Cannot write incompatible data for 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>."

Review Comment:
   ```suggestion
             "Cannot find data for the output column <colPath>."
   ```



-- 
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