MaxGekk commented on a change in pull request #34852:
URL: https://github.com/apache/spark/pull/34852#discussion_r767445549
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
##########
@@ -375,23 +375,25 @@ case class AesEncrypt(
@ExpressionDescription(
usage = """
_FUNC_(expr, key[, mode[, padding]]) - Returns a decrepted value of `expr`
using AES in `mode` with `padding`.
- Key lengths of 16, 24 and 32 bits are supported.
+ Key lengths of 16, 24 and 32 bits are supported. Supported combinations
of (`mode`, `padding`) are ('ECB', 'PKCS') and ('GCM', 'NONE').
""",
arguments = """
Arguments:
* expr - The binary value to decrypt.
* key - The passphrase to use to decrypt the data.
* mode - Specifies which block cipher mode should be used to decrypt
messages.
- Valid modes: ECB.
+ Valid modes: ECB, GCM.
* padding - Specifies how to pad messages whose length is not a multiple
of the block size.
- Valid values: PKCS.
+ Valid values: PKCS, NONE.
Review comment:
> We can also require the mode and padding parameter to be constant, to
simplify the implementation.
I wouldn't do that because it is unnecessary restriction from my point of
view. I could image an use case when data gathered from different sources and
encrypted slightly differently (using different padding/modes), and process in
one places. What you propose requires to somehow split input data by
dataframes (or selects + unions) and process them separately. Don't see any
reasons to bring such pains to users.
> Shall we have a smarter way to decide the default padding? e.g. if the
mode is GCM, the default padding is NONE.
I think of introducing the `DEFAULT` value for padding which the AES
implementation substitutes by concrete value (`NONE` or `PKCS`) depending on
the mode.
--
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]