Sid4030 opened a new pull request, #59767:
URL: https://github.com/apache/spark/pull/59767
### What changes were proposed in this pull request?
This PR updates `FromProtobuf` and `ToProtobuf` in
`toFromProtobufSqlFunctions.scala` to throw
`QueryCompilationErrors.nullArgumentError` instead of a raw
`IllegalArgumentException("Message name cannot be null")` when `messageName`
evaluates to `null`.
### Why are the changes needed?
Throwing raw unclassified Java exceptions violates Apache Spark's Error
Class framework. Using `QueryCompilationErrors.nullArgumentError` standardizes
the error to the `INVALID_PARAMETER_VALUE.NULL` error class.
### Does this PR introduce _any_ user-facing change?
No user-facing change other than providing a standardized error class
(`INVALID_PARAMETER_VALUE.NULL`) when a null message name is provided.
### How was this patch tested?
- Added unit tests in `ProtobufFunctionsSuite.scala` verifying
`INVALID_PARAMETER_VALUE.NULL` for both `from_protobuf` and `to_protobuf`.
- Ran test suite locally:
`build/sbt 'protobuf/testOnly *ProtobufFunctionsSuite'` (56/56 passed).
### Was this patch authored or co-authored using generative AI tooling?
No
--
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]