diff options
author | Reynold Xin <rxin@databricks.com> | 2016-02-19 22:44:20 -0800 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-02-19 22:44:20 -0800 |
commit | 6624a588c1b3b6c05fb39285bc6215102dd109c6 (patch) | |
tree | 75671732b5e2ef5d0e2e0ab07a590353a89b8726 /sql/core/src | |
parent | 4f9a66481849dc867cf6592d53e0e9782361d20a (diff) | |
download | spark-6624a588c1b3b6c05fb39285bc6215102dd109c6.tar.gz spark-6624a588c1b3b6c05fb39285bc6215102dd109c6.tar.bz2 spark-6624a588c1b3b6c05fb39285bc6215102dd109c6.zip |
Revert "[SPARK-12567] [SQL] Add aes_{encrypt,decrypt} UDFs"
This reverts commit 4f9a66481849dc867cf6592d53e0e9782361d20a.
Diffstat (limited to 'sql/core/src')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/functions.scala | 36 | ||||
-rw-r--r-- | sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala | 24 |
2 files changed, 0 insertions, 60 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala index 8da50bedfc..97c6992e18 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala @@ -1982,42 +1982,6 @@ object functions extends LegacyFunctions { new Murmur3Hash(cols.map(_.expr)) } - /** - * Encrypts input using AES and Returns the result as a binary column. - * Key lengths of 128, 192 or 256 bits can be used. 192 and 256 bits keys can be used if Java - * Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files are installed. If - * either argument is NULL, the result will also be null. If input is invalid, key length is not - * one of the permitted values or using 192/256 bits key before installing JCE, an exception will - * be thrown. - * - * @param input binary column to encrypt input - * @param key binary column of 128, 192 or 256 bits key - * - * @group misc_funcs - * @since 2.0.0 - */ - def aes_encrypt(input: Column, key: Column): Column = withExpr { - AesEncrypt(input.expr, key.expr) - } - - /** - * Decrypts input using AES and Returns the result as a string column. - * Key lengths of 128, 192 or 256 bits can be used. 192 and 256 bits keys can be used if Java - * Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files are installed. If - * either argument is NULL, the result will also be null. If input is invalid, key length is not - * one of the permitted values or using 192/256 bits key before installing JCE, an exception will - * be thrown. - * - * @param input binary column to decrypt input - * @param key binary column of 128, 192 or 256 bits key - * - * @group misc_funcs - * @since 2.0.0 - */ - def aes_decrypt(input: Column, key: Column): Column = withExpr { - AesDecrypt(input.expr, key.expr) - } - ////////////////////////////////////////////////////////////////////////////////////////////// // String functions ////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala index 0381d57280..aff9efe4b2 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala @@ -206,30 +206,6 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSQLContext { Row(2743272264L, 2180413220L)) } - test("misc aes encrypt function") { - val df = Seq(("ABC", "1234567890123456")).toDF("input", "key") - checkAnswer( - df.select(base64(aes_encrypt($"input", $"key"))), - Row("y6Ss+zCYObpCbgfWfyNWTw==") - ) - checkAnswer( - sql("SELECT base64(aes_encrypt('', '1234567890123456'))"), - Row("BQGHoM3lqYcsurCRq3PlUw==") - ) - } - - test("misc aes decrypt function") { - val df = Seq(("y6Ss+zCYObpCbgfWfyNWTw==", "1234567890123456")).toDF("input", "key") - checkAnswer( - df.select((aes_decrypt(unbase64($"input"), $"key"))), - Row("ABC") - ) - checkAnswer( - sql("SELECT aes_decrypt(unbase64('BQGHoM3lqYcsurCRq3PlUw=='), '1234567890123456')"), - Row("") - ) - } - test("string function find_in_set") { val df = Seq(("abc,b,ab,c,def", "abc,b,ab,c,def")).toDF("a", "b") |