cloud-fan commented on a change in pull request #32801:
URL: https://github.com/apache/spark/pull/32801#discussion_r727820746



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
##########
@@ -301,3 +306,105 @@ case class CurrentUser() extends LeafExpression with 
Unevaluable {
   override def prettyName: String = "current_user"
   final override val nodePatterns: Seq[TreePattern] = Seq(CURRENT_LIKE)
 }
+
+/**
+ * The concrete implementation for AES encryption and decryption.
+ */
+object AesImpl {

Review comment:
       Can we write it in java? e.g. `class ExpressionCodegenImpl` under 
`org.apache.spark.sql.catalyst.expressions.codegen`, and we can add more static 
methods in the future when we add new expressions.

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1826,4 +1826,9 @@ object QueryExecutionErrors {
   def pivotNotAfterGroupByUnsupportedError(): Throwable = {
     new UnsupportedOperationException("pivot is only supported after a 
groupBy")
   }
+
+  def invalidAesKeyLengthError(actualLength: Int): Throwable = {
+    new SparkException(

Review comment:
       `RuntimeException` seems better

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1826,4 +1826,9 @@ object QueryExecutionErrors {
   def pivotNotAfterGroupByUnsupportedError(): Throwable = {
     new UnsupportedOperationException("pivot is only supported after a 
groupBy")
   }
+
+  def invalidAesKeyLengthError(actualLength: Int): Throwable = {
+    new SparkException(
+      s"The key length should be one of 16, 24 or 32 bytes (the actual length 
is $actualLength)")

Review comment:
       ```suggestion
         s"The key length of aes_encrypt/aes_decrypt should be one of 16, 24 or 
32 bytes, but got: $actualLength")
   ```

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
##########
@@ -301,3 +306,105 @@ case class CurrentUser() extends LeafExpression with 
Unevaluable {
   override def prettyName: String = "current_user"
   final override val nodePatterns: Seq[TreePattern] = Seq(CURRENT_LIKE)
 }
+
+/**
+ * The concrete implementation for AES encryption and decryption.
+ */
+object AesImpl {

Review comment:
       Can we write it in java? e.g. `class ExpressionImplUtils` under 
`org.apache.spark.sql.catalyst.expressions.codegen`, and we can add more static 
methods in the future when we add new expressions.

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
##########
@@ -301,3 +306,105 @@ case class CurrentUser() extends LeafExpression with 
Unevaluable {
   override def prettyName: String = "current_user"
   final override val nodePatterns: Seq[TreePattern] = Seq(CURRENT_LIKE)
 }
+
+/**
+ * The concrete implementation for AES encryption and decryption.
+ */
+object AesImpl {

Review comment:
       Can we write it in java? e.g. `class ExpressionImplUtils` under 
`org.apache.spark.sql.catalyst.expressions`, and we can add more static methods 
in the future when we add new expressions.




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