AbinayaJayaprakasam commented on code in PR #53251:
URL: https://github.com/apache/spark/pull/53251#discussion_r2569842106


##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -6029,6 +6029,12 @@
     ],
     "sqlState" : "428EK"
   },
+  "TEMP_VIEW_WRITE_NOT_ALLOWED" : {
+    "message" : [
+      "Cannot write into temp view <quoted> as it's not a data source v2 
relation."
+    ],
+    "sqlState" : "42623"

Review Comment:
   Thank you .. You're absolutely right. 
   
   I initially chose 42623 because I saw it used for other write constraint 
errors in Spark, but after reviewing the SQL state definitions, 42809 ("The 
identified object is not the type of object to which the statement applies") is 
indeed more semantically accurate for this error.
   
   The error occurs because the temp view is not a DataSource V2 relation, 
which is exactly an "object type mismatch" scenario that 42809 is designed for.
   
   I've updated the PR to use 42809. Thank you for the careful review!
   
   **References:**
   - IBM DB2: [42809 - Wrong object 
type](https://www.ibm.com/docs/en/db2/11.5?topic=messages-sqlstate)
   - PostgreSQL: [42809 - Wrong object 
type](https://www.postgresql.org/docs/current/errcodes-appendix.html)



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

Reply via email to