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


##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -411,13 +417,13 @@
     "message" : [
       "The range columns in BIN BY must be TIMESTAMP or TIMESTAMP_NTZ. Column 
<columnName> has type <columnType>. Both range columns must have the same type."
     ],
-    "sqlState" : "42804"
+    "sqlState" : "42K09"
   },
   "BIN_BY_REQUIRES_TOP_LEVEL_COLUMN" : {
     "message" : [
       "BIN BY requires a top-level column, but <columnName> is a nested or 
computed field. Alias it to a top-level column in a select before BIN BY."
     ],
-    "sqlState" : "42K09"
+    "sqlState" : "0A000"

Review Comment:
   Optional / non-blocking consistency question. The existing 
`EVENT_TIME_MUST_BE_TOP_LEVEL_COLUMN` condition carries a near-identical 
message ("must be a top-level column, but `<...>` is a nested field ... alias 
it to a top-level column in a select before withWatermark") but uses SQLSTATE 
`42K09`. Here `BIN_BY_REQUIRES_TOP_LEVEL_COLUMN` adopts `0A000` ("feature not 
supported").
   
   `0A000` is defensible and arguably more precise — the restriction is 
structural (nested/computed field not accepted), not a data-type mismatch. Just 
flagging the divergence from the established top-level-column peer in case 
matching it (`42K09`) is preferred for consistency. Either way is fine.



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