From 6624a588c1b3b6c05fb39285bc6215102dd109c6 Mon Sep 17 00:00:00 2001 From: Reynold Xin Date: Fri, 19 Feb 2016 22:44:20 -0800 Subject: Revert "[SPARK-12567] [SQL] Add aes_{encrypt,decrypt} UDFs" This reverts commit 4f9a66481849dc867cf6592d53e0e9782361d20a. --- python/pyspark/sql/functions.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'python/pyspark/sql') diff --git a/python/pyspark/sql/functions.py b/python/pyspark/sql/functions.py index 7d038b8d9e..5fc1cc2cae 100644 --- a/python/pyspark/sql/functions.py +++ b/python/pyspark/sql/functions.py @@ -1125,43 +1125,6 @@ def hash(*cols): return Column(jc) -@ignore_unicode_prefix -@since(2.0) -def aes_encrypt(input, key): - """ - Encrypts input of given column using AES. 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 Jurisdic- - tion Policy Files are installed. 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. - - >>> df = sqlContext.createDataFrame([('ABC','1234567890123456')], ['input','key']) - >>> df.select(base64(aes_encrypt(df.input, df.key)).alias('aes')).collect() - [Row(aes=u'y6Ss+zCYObpCbgfWfyNWTw==')] - """ - sc = SparkContext._active_spark_context - jc = sc._jvm.functions.aes_encrypt(_to_java_column(input), _to_java_column(key)) - return Column(jc) - - -@ignore_unicode_prefix -@since(2.0) -def aes_decrypt(input, key): - """ - Decrypts input of given column using AES. 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 Jurisdic- - tion Policy Files are installed. 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. - - >>> df = sqlContext.createDataFrame([(u'y6Ss+zCYObpCbgfWfyNWTw==','1234567890123456')], \ - ['input','key']) - >>> df.select(aes_decrypt(unbase64(df.input), df.key).alias('aes')).collect() - [Row(aes=u'ABC')] - """ - sc = SparkContext._active_spark_context - jc = sc._jvm.functions.aes_decrypt(_to_java_column(input), _to_java_column(key)) - return Column(jc) - - # ---------------------- String/Binary functions ------------------------------ _string_functions = { -- cgit v1.2.3