[SPARK-37979][SQL] Switch to more generic error classes in AES functions#35272
[SPARK-37979][SQL] Switch to more generic error classes in AES functions#35272MaxGekk wants to merge 7 commits intoapache:masterfrom
Conversation
|
@cloud-fan @sarutak @srielau @entong Could you review this PR, please. |
There was a problem hiding this comment.
mode is also a parameter of the aes function, shall we reuse INVALID_PARAMETER_VALUE
There was a problem hiding this comment.
Actually, any failure/error can be considered as a result of an invalid parameter. We could consider the entire universe as the input to Spark's code.
There was a problem hiding this comment.
@cloud-fan What is the use case for the sqlState = 0A000 (feature not supported, see https://github.com/apache/spark/tree/master/core/src/main/resources/error) from your point of view?
There was a problem hiding this comment.
how about The value of parameter '%s' in %s is invalid: %s. Then we can have something like
The value of parameter 'key' in function 'aes_encrypt/aes_decrypt' is invalid: expects a binary value with 16, 24 or 32 bytes, but got 9 bytes.
There was a problem hiding this comment.
| "aes_encrypt/aes_decrypt", | |
| "function aes_encrypt/aes_decrypt", |
There was a problem hiding this comment.
| messageParameters = Array(s"AES-$mode with the padding $padding")) | |
| messageParameters = Array(s"AES-$mode with the padding $padding in function aes_encrypt/aes_decrypt")) |
There was a problem hiding this comment.
| "aes_encrypt/aes_decrypt", | |
| "function aes_encrypt/aes_decrypt", |
|
Merging to master. Thank you, @cloud-fan . |
What changes were proposed in this pull request?
In the PR, I propose to switch from specific error classes in the AES functions:
aes_encrypt()/aes_decrypt()to more generic:The new error classes
INVALID_PARAMETER_VALUEandUNSUPPORTED_MODEare made to be re-used from other functions but not only in the AES functions.Why are the changes needed?
error-classes.json.Does this PR introduce any user-facing change?
Yes, but the AES functions
aes_encrypt()/aes_decrypt()haven't released yet.How was this patch tested?
By running the affected test suites: