hive git commit: HIVE-11593 Add aes_encrypt and aes_decrypt UDFs (Alexander Pivovarov, reviewed by Jason Dere)
Repository: hive Updated Branches: refs/heads/branch-1 3bbfbc377 -> f60a6241b HIVE-11593 Add aes_encrypt and aes_decrypt UDFs (Alexander Pivovarov, reviewed by Jason Dere) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/f60a6241 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f60a6241 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f60a6241 Branch: refs/heads/branch-1 Commit: f60a6241bb05d3a98c07f6ed8195a959215b970c Parents: 3bbfbc3 Author: Alexander PivovarovAuthored: Sun Aug 16 18:36:32 2015 -0700 Committer: Alexander Pivovarov Committed: Sat Sep 5 19:31:24 2015 -0700 -- .../hadoop/hive/ql/exec/FunctionRegistry.java | 2 + .../hive/ql/udf/generic/GenericUDFAesBase.java | 205 .../ql/udf/generic/GenericUDFAesDecrypt.java| 50 .../ql/udf/generic/GenericUDFAesEncrypt.java| 50 .../ql/udf/generic/GenericUDFParamUtils.java| 8 +- .../udf/generic/TestGenericUDFAesDecrypt.java | 233 +++ .../udf/generic/TestGenericUDFAesEncrypt.java | 228 ++ .../queries/clientpositive/udf_aes_decrypt.q| 21 ++ .../queries/clientpositive/udf_aes_encrypt.q| 21 ++ .../results/clientpositive/show_functions.q.out | 2 + .../clientpositive/udf_aes_decrypt.q.out| 79 +++ .../clientpositive/udf_aes_encrypt.q.out| 79 +++ 12 files changed, 977 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/f60a6241/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java index 9edcc4d..0f324ca 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java @@ -233,6 +233,8 @@ public final class FunctionRegistry { system.registerUDF("md5", UDFMd5.class, false); system.registerUDF("sha1", UDFSha1.class, false); system.registerUDF("sha", UDFSha1.class, false); +system.registerGenericUDF("aes_encrypt", GenericUDFAesEncrypt.class); +system.registerGenericUDF("aes_decrypt", GenericUDFAesDecrypt.class); system.registerGenericUDF("encode", GenericUDFEncode.class); system.registerGenericUDF("decode", GenericUDFDecode.class); http://git-wip-us.apache.org/repos/asf/hive/blob/f60a6241/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAesBase.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAesBase.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAesBase.java new file mode 100644 index 000..66a4457 --- /dev/null +++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAesBase.java @@ -0,0 +1,205 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.ql.udf.generic; + +import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveGrouping.BINARY_GROUP; +import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveGrouping.STRING_GROUP; + +import java.security.GeneralSecurityException; +import java.security.NoSuchAlgorithmException; + +import javax.crypto.Cipher; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.hadoop.hive.ql.exec.UDFArgumentException; +import org.apache.hadoop.hive.ql.metadata.HiveException; +import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.Converter; +import
hive git commit: HIVE-11593 Add aes_encrypt and aes_decrypt UDFs (Alexander Pivovarov, reviewed by Jason Dere)
Repository: hive Updated Branches: refs/heads/master 8bed378ea -> f4acb44f6 HIVE-11593 Add aes_encrypt and aes_decrypt UDFs (Alexander Pivovarov, reviewed by Jason Dere) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/f4acb44f Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f4acb44f Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f4acb44f Branch: refs/heads/master Commit: f4acb44f67b64e85f53de6d8503ef2ae6e0fa524 Parents: 8bed378 Author: Alexander PivovarovAuthored: Sun Aug 16 18:36:32 2015 -0700 Committer: Alexander Pivovarov Committed: Sat Sep 5 19:24:50 2015 -0700 -- .../hadoop/hive/ql/exec/FunctionRegistry.java | 2 + .../hive/ql/udf/generic/GenericUDFAesBase.java | 205 .../ql/udf/generic/GenericUDFAesDecrypt.java| 50 .../ql/udf/generic/GenericUDFAesEncrypt.java| 50 .../ql/udf/generic/GenericUDFParamUtils.java| 8 +- .../udf/generic/TestGenericUDFAesDecrypt.java | 233 +++ .../udf/generic/TestGenericUDFAesEncrypt.java | 228 ++ .../queries/clientpositive/udf_aes_decrypt.q| 21 ++ .../queries/clientpositive/udf_aes_encrypt.q| 21 ++ .../results/clientpositive/show_functions.q.out | 2 + .../clientpositive/udf_aes_decrypt.q.out| 79 +++ .../clientpositive/udf_aes_encrypt.q.out| 79 +++ 12 files changed, 977 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/f4acb44f/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java index 4c1c53e..f1fe30d 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java @@ -234,6 +234,8 @@ public final class FunctionRegistry { system.registerUDF("md5", UDFMd5.class, false); system.registerUDF("sha1", UDFSha1.class, false); system.registerUDF("sha", UDFSha1.class, false); +system.registerGenericUDF("aes_encrypt", GenericUDFAesEncrypt.class); +system.registerGenericUDF("aes_decrypt", GenericUDFAesDecrypt.class); system.registerGenericUDF("encode", GenericUDFEncode.class); system.registerGenericUDF("decode", GenericUDFDecode.class); http://git-wip-us.apache.org/repos/asf/hive/blob/f4acb44f/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAesBase.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAesBase.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAesBase.java new file mode 100644 index 000..66a4457 --- /dev/null +++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAesBase.java @@ -0,0 +1,205 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hive.ql.udf.generic; + +import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveGrouping.BINARY_GROUP; +import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveGrouping.STRING_GROUP; + +import java.security.GeneralSecurityException; +import java.security.NoSuchAlgorithmException; + +import javax.crypto.Cipher; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +import org.apache.hadoop.hive.ql.exec.UDFArgumentException; +import org.apache.hadoop.hive.ql.metadata.HiveException; +import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorConverters.Converter; +import
hive git commit: HIVE-11743: HBase Port conflict for MiniHBaseCluster
Repository: hive Updated Branches: refs/heads/hbase-metastore 757553e64 -> 76828e0ad HIVE-11743: HBase Port conflict for MiniHBaseCluster Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/76828e0a Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/76828e0a Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/76828e0a Branch: refs/heads/hbase-metastore Commit: 76828e0ade2e55d30b0680c7312737a8212a158f Parents: 757553e Author: Daniel DaiAuthored: Sat Sep 5 11:12:21 2015 -0700 Committer: Daniel Dai Committed: Sat Sep 5 11:12:21 2015 -0700 -- .../hadoop/hive/metastore/hbase/HBaseIntegrationTests.java | 8 +++- .../src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java | 6 +- 2 files changed, 12 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/76828e0a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/hbase/HBaseIntegrationTests.java -- diff --git a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/hbase/HBaseIntegrationTests.java b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/hbase/HBaseIntegrationTests.java index 02e481a..5b82579 100644 --- a/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/hbase/HBaseIntegrationTests.java +++ b/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/hbase/HBaseIntegrationTests.java @@ -19,8 +19,11 @@ package org.apache.hadoop.hive.metastore.hbase; import co.cask.tephra.hbase10.coprocessor.TransactionProcessor; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; @@ -32,6 +35,7 @@ import org.apache.hadoop.hive.ql.Driver; import org.apache.hadoop.hive.ql.security.SessionStateConfigUserAuthenticator; import org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactoryForTest; import org.apache.hadoop.hive.ql.session.SessionState; + import java.io.IOException; import java.util.HashMap; import java.util.List; @@ -60,7 +64,9 @@ public class HBaseIntegrationTests { if (testingTephra) { LOG.info("Testing with Tephra"); } -utility = new HBaseTestingUtility(); +Configuration hbaseConf = HBaseConfiguration.create(); +hbaseConf.setInt("hbase.master.info.port", -1); +utility = new HBaseTestingUtility(hbaseConf); utility.startMiniCluster(); conf = new HiveConf(utility.getConfiguration(), HBaseIntegrationTests.class); admin = utility.getHBaseAdmin(); http://git-wip-us.apache.org/repos/asf/hive/blob/76828e0a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java -- diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index 24a85cf..16e73c9 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -62,9 +62,11 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster; @@ -348,7 +350,9 @@ public class QTestUtil { } private void startMiniHBaseCluster() throws Exception { -utility = new HBaseTestingUtility(); +Configuration hbaseConf = HBaseConfiguration.create(); +hbaseConf.setInt("hbase.master.info.port", -1); +utility = new HBaseTestingUtility(hbaseConf); utility.startMiniCluster(); conf = new HiveConf(utility.getConfiguration(), Driver.class); HBaseAdmin admin = utility.getHBaseAdmin();