MaxGekk opened a new pull request #34837: URL: https://github.com/apache/spark/pull/34837
### What changes were proposed in this pull request? In the PR, I propose to add new optional arguments to the `aes_encrypt()` and `aes_decrypt()` functions with default values: 1. `mode` - specifies which block cipher mode should be used to encrypt/decrypt messages. Only one valid value is `ECB` at the moment. 2. `padding` - specifies how to pad messages whose length is not a multiple of the block size. Only one valid value is `PKCS`. In this way, when an user doesn't pass `mode`/`padding` to the functions, the functions apply AES encryption/decryption in the `ECB` mode with the `PKCS5Padding` padding. ### Why are the changes needed? 1. At the moment, `aes_encrypt()` and `aes_decrypt()` rely on the jvm's configuration regarding which cipher mode to support, this is problematic as it is not fixed across versions and systems. By using default constants for new arguments, we can guarantee the same behaviour across all supported environments. 2. We can consider new arguments as new point of extension in the current implementation of AES algorithm in Spark SQL. In the future or in private forks, Spark devs can implement other modes and paddings like GCM. ### Does this PR introduce _any_ user-facing change? No. This PR just extends existing APIs. ### How was this patch tested? By running new checks: ``` $ build/sbt "test:testOnly org.apache.spark.sql.DataFrameFunctionsSuite" $ build/sbt "sql/test:testOnly org.apache.spark.sql.expressions.ExpressionInfoSuite" ``` -- 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]
