[GitHub] [spark] srielau commented on a diff in pull request #38861: [SPARK-41294][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1203 / 1168

2022-12-19 Thread GitBox


srielau commented on code in PR #38861:
URL: https://github.com/apache/spark/pull/38861#discussion_r1052745779


##
sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out:
##
@@ -3831,12 +3831,12 @@ struct<>
 -- !query output
 org.apache.spark.sql.AnalysisException
 {
-  "errorClass" : "_LEGACY_ERROR_TEMP_1168",
+  "errorClass" : "NUM_COLUMNS_MISMATCH",
   "messageParameters" : {
-"insertedColumns" : "5",
-"staticPartCols" : "0",
-"tableName" : "`spark_catalog`.`default`.`num_result`",
-"targetColumns" : "3"
+"firstNumColumns" : "3",
+"invalidNumColumns" : "5",
+"invalidOrdinalNum" : "second",

Review Comment:
   Not really Ok with that. I'm also confused by the "second" portion. That 
doesn't translate and seems unnecessary compared to "1." and "2.".
   Should we have a dedicated error message? Especially INSERT INTO has an 
optional column list, so there are many ways to "fix" the error. It's not the 
same as a UNION ALL or an EXCEPT.




-- 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] srielau commented on a diff in pull request #38861: [SPARK-41294][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1203 / 1168

2022-12-05 Thread GitBox


srielau commented on code in PR #38861:
URL: https://github.com/apache/spark/pull/38861#discussion_r1039709066


##
core/src/main/resources/error/error-classes.json:
##
@@ -876,6 +876,13 @@
 ],
 "sqlState" : "42000"
   },
+  "NOT_ENOUGH_DATA_COLUMNS" : {
+"message" : [
+  "Cannot write to , not enough data columns:",

Review Comment:
   Given that we have columns defaults, at least in the case of insert it's not 
really about the target table, but the column list.
   I take it the same error is raised on UPDATE T SET  (...) = (...)?  and 
UNION/EXCEPT/...  ( ) .. IN ( SELECT ...) ?
   
   How about \ expects matching number of columns. But the left side 
(target) has \ while the right side (source> has \.
   
   Alternatively we could talk about "assignments" using a different error 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] [spark] srielau commented on a diff in pull request #38861: [SPARK-41294][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1203 / 1168

2022-12-05 Thread GitBox


srielau commented on code in PR #38861:
URL: https://github.com/apache/spark/pull/38861#discussion_r1039709066


##
core/src/main/resources/error/error-classes.json:
##
@@ -876,6 +876,13 @@
 ],
 "sqlState" : "42000"
   },
+  "NOT_ENOUGH_DATA_COLUMNS" : {
+"message" : [
+  "Cannot write to , not enough data columns:",

Review Comment:
   Given that we have columns defaults, at least in the case of insert it's not 
really about the target table, but the column list.
   I take it the same error is raised on UPDATE T SET  (...) = (...)?  and 
UNION/EXCEPT/...  ( ) .. IN ( SELECT ...) ?
   
   How about  expects matching number of columns. But the left side 
has  while the right side has .
   
   Alternatively we could talk about "assignments" using a different error 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org