ilicmarkodb opened a new pull request, #54609:
URL: https://github.com/apache/spark/pull/54609

   ### What changes were proposed in this pull request?
   
   Rename the legacy error class `_LEGACY_ERROR_TEMP_1309` to 
`PARTITION_BY_NOT_ALLOWED_WITH_INSERT_INTO` and add SQL state `42601`.
   
   This error is thrown when a user calls `insertInto()` together with 
`partitionBy()` on a `DataFrameWriter`, which is an invalid API usage since the 
target table's partition columns are already defined.
   
   ### Why are the changes needed?
   
   Legacy error classes with temporary names (`_LEGACY_ERROR_TEMP_*`) are being 
migrated to proper descriptive names as part of the ongoing error framework 
improvements. Adding a SQL state makes the error easier to identify and handle 
programmatically.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. The error class name changes from `_LEGACY_ERROR_TEMP_1309` to 
`PARTITION_BY_NOT_ALLOWED_WITH_INSERT_INTO`, and the SQL state `42601` is now 
included (previously it was `null`). The error message text remains identical.
   
   ### How was this patch tested?
   
   Existing test in `InsertSuite.scala` already covers this error and has been 
updated with the new error class name.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes, co-authored with Claude Code.


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