hive git commit: HIVE-13391 : add an option to LLAP to use keytab to authenticate to read data (Sergey Shelukhin, reviewed by Siddharth Seth)
Repository: hive Updated Branches: refs/heads/master edc5974a1 -> 7a4fd3377 HIVE-13391 : add an option to LLAP to use keytab to authenticate to read data (Sergey Shelukhin, reviewed by Siddharth Seth) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/7a4fd337 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/7a4fd337 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/7a4fd337 Branch: refs/heads/master Commit: 7a4fd3377e8a34de724ec45ec61793ac00ae92bc Parents: edc5974 Author: Sergey Shelukhin Authored: Wed Jun 8 14:49:44 2016 -0700 Committer: Sergey Shelukhin Committed: Wed Jun 8 14:49:44 2016 -0700 -- .../apache/hadoop/hive/common/UgiFactory.java | 22 +++ .../org/apache/hadoop/hive/conf/HiveConf.java | 6 ++ .../impl/LlapZookeeperRegistryImpl.java | 1 + .../llap/daemon/impl/ContainerRunnerImpl.java | 10 ++- .../hive/llap/daemon/impl/LlapDaemon.java | 10 ++- .../llap/daemon/impl/TaskRunnerCallable.java| 8 ++- .../hive/llap/io/api/impl/LlapIoImpl.java | 6 +- .../llap/io/decode/ColumnVectorProducer.java| 2 +- .../llap/security/LlapUgiFactoryFactory.java| 67 .../daemon/impl/TaskExecutorTestHelpers.java| 2 +- .../apache/hadoop/hive/shims/Hadoop23Shims.java | 44 + .../apache/hadoop/hive/shims/HadoopShims.java | 2 + 12 files changed, 169 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/7a4fd337/common/src/java/org/apache/hadoop/hive/common/UgiFactory.java -- diff --git a/common/src/java/org/apache/hadoop/hive/common/UgiFactory.java b/common/src/java/org/apache/hadoop/hive/common/UgiFactory.java new file mode 100644 index 000..5b1ce60 --- /dev/null +++ b/common/src/java/org/apache/hadoop/hive/common/UgiFactory.java @@ -0,0 +1,22 @@ +/* + * Licensed 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.common; + +import java.io.IOException; +import org.apache.hadoop.security.UserGroupInformation; + +public interface UgiFactory { + UserGroupInformation createUgi() throws IOException; +} http://git-wip-us.apache.org/repos/asf/hive/blob/7a4fd337/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java -- diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 2d7489b..bb0ca3a 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2702,6 +2702,12 @@ public class HiveConf extends Configuration { LLAP_ZKSM_KERBEROS_KEYTAB_FILE("hive.llap.zk.sm.keytab.file", "", "The path to the Kerberos Keytab file containing the principal to use to talk to\n" + "ZooKeeper for ZooKeeper SecretManager."), +LLAP_FS_KERBEROS_PRINCIPAL("hive.llap.task.principal", "", +"The name of the principal to use to run tasks. By default, the clients are required\n" + +"to provide tokens to access HDFS/etc."), +LLAP_FS_KERBEROS_KEYTAB_FILE("hive.llap.task.keytab.file", "", +"The path to the Kerberos Keytab file containing the principal to use to run tasks.\n" + +"By default, the clients are required to provide tokens to access HDFS/etc."), LLAP_ZKSM_ZK_CONNECTION_STRING("hive.llap.zk.sm.connectionString", "", "ZooKeeper connection string for ZooKeeper SecretManager."), LLAP_ZK_REGISTRY_USER("hive.llap.zk.registry.user", "", http://git-wip-us.apache.org/repos/asf/hive/blob/7a4fd337/llap-client/src/java/org/apache/hadoop/hive/llap/registry/impl/LlapZookeeperRegistryImpl.java -- diff --git a/llap-client/src/java/org/apache/hadoop/hive/llap/registry/impl/LlapZookeeperRegistryImpl.java b/llap-client/src/java/org/apache/hadoop/hive/llap/registry/impl/LlapZookeeperRegistryImpl.java index 154081d..551fcc5 100644 --- a/llap-client/src/java/org/apache/hadoop/hive/llap/registry/impl/LlapZookeeperRegistryImpl.java +++ b/llap-client/src/java/org/apache/hadoop/hive/llap/registry/impl/LlapZookeeperRegistryImpl.java @@ -503,6 +50
hive git commit: HIVE-13972 : Resolve class dependency issue introduced by HIVE-13354 (Wei Zheng, reviewed by Eugene Koifman)
Repository: hive Updated Branches: refs/heads/branch-1 52c7c04b0 -> df3746565 HIVE-13972 : Resolve class dependency issue introduced by HIVE-13354 (Wei Zheng, reviewed by Eugene Koifman) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/df374656 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/df374656 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/df374656 Branch: refs/heads/branch-1 Commit: df37465651858fd3502b01044b237d074a5125c4 Parents: 52c7c04 Author: Wei Zheng Authored: Wed Jun 8 13:52:45 2016 -0700 Committer: Wei Zheng Committed: Wed Jun 8 13:52:45 2016 -0700 -- .../hadoop/hive/common/StringableMap.java | 80 .../hadoop/hive/metastore/txn/TxnHandler.java | 2 +- .../hadoop/hive/metastore/txn/TxnUtils.java | 54 - .../hive/ql/txn/compactor/CompactorMR.java | 2 +- .../hive/ql/txn/compactor/TestWorker.java | 2 +- 5 files changed, 83 insertions(+), 57 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/df374656/common/src/java/org/apache/hadoop/hive/common/StringableMap.java -- diff --git a/common/src/java/org/apache/hadoop/hive/common/StringableMap.java b/common/src/java/org/apache/hadoop/hive/common/StringableMap.java new file mode 100644 index 000..8a93c0f --- /dev/null +++ b/common/src/java/org/apache/hadoop/hive/common/StringableMap.java @@ -0,0 +1,80 @@ +/** + * 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.common; + + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +/** + * A utility class that can convert a HashMap of Properties into a colon separated string, + * and can take the same format of string and convert it to a HashMap of Properties. + */ +public class StringableMap extends HashMap { + + public StringableMap(String s) { +String[] parts = s.split(":", 2); +// read that many chars +int numElements = Integer.parseInt(parts[0]); +s = parts[1]; +for (int i = 0; i < numElements; i++) { + parts = s.split(":", 2); + int len = Integer.parseInt(parts[0]); + String key = null; + if (len > 0) key = parts[1].substring(0, len); + parts = parts[1].substring(len).split(":", 2); + len = Integer.parseInt(parts[0]); + String value = null; + if (len > 0) value = parts[1].substring(0, len); + s = parts[1].substring(len); + put(key, value); +} + } + + public StringableMap(Map m) { +super(m); + } + + @Override + public String toString() { +StringBuilder buf = new StringBuilder(); +buf.append(size()); +buf.append(':'); +if (size() > 0) { + for (Map.Entry entry : entrySet()) { +int length = (entry.getKey() == null) ? 0 : entry.getKey().length(); +buf.append(entry.getKey() == null ? 0 : length); +buf.append(':'); +if (length > 0) buf.append(entry.getKey()); +length = (entry.getValue() == null) ? 0 : entry.getValue().length(); +buf.append(length); +buf.append(':'); +if (length > 0) buf.append(entry.getValue()); + } +} +return buf.toString(); + } + + public Properties toProperties() { +Properties props = new Properties(); +props.putAll(this); +return props; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/df374656/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java -- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java index 129abef..0902121 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java @@ -34,13 +34,13 @@ import org.apache.commons.dbcp.PoolingDataSource; import org.apache.commons.pool.ObjectPool; import org
hive git commit: HIVE-13972 : Resolve class dependency issue introduced by HIVE-13354 (Wei Zheng, reviewed by Eugene Koifman)
Repository: hive Updated Branches: refs/heads/branch-2.1 1bc13cb36 -> 185d9c572 HIVE-13972 : Resolve class dependency issue introduced by HIVE-13354 (Wei Zheng, reviewed by Eugene Koifman) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/185d9c57 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/185d9c57 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/185d9c57 Branch: refs/heads/branch-2.1 Commit: 185d9c57269cc6b673aa3950a8909b7157cd0197 Parents: 1bc13cb Author: Wei Zheng Authored: Wed Jun 8 13:26:14 2016 -0700 Committer: Wei Zheng Committed: Wed Jun 8 13:26:14 2016 -0700 -- .../hadoop/hive/common/StringableMap.java | 80 .../hadoop/hive/metastore/txn/TxnHandler.java | 2 +- .../hadoop/hive/metastore/txn/TxnUtils.java | 54 - .../hive/ql/txn/compactor/CompactorMR.java | 2 +- .../hive/ql/txn/compactor/TestWorker.java | 2 +- 5 files changed, 83 insertions(+), 57 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/185d9c57/common/src/java/org/apache/hadoop/hive/common/StringableMap.java -- diff --git a/common/src/java/org/apache/hadoop/hive/common/StringableMap.java b/common/src/java/org/apache/hadoop/hive/common/StringableMap.java new file mode 100644 index 000..8a93c0f --- /dev/null +++ b/common/src/java/org/apache/hadoop/hive/common/StringableMap.java @@ -0,0 +1,80 @@ +/** + * 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.common; + + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +/** + * A utility class that can convert a HashMap of Properties into a colon separated string, + * and can take the same format of string and convert it to a HashMap of Properties. + */ +public class StringableMap extends HashMap { + + public StringableMap(String s) { +String[] parts = s.split(":", 2); +// read that many chars +int numElements = Integer.parseInt(parts[0]); +s = parts[1]; +for (int i = 0; i < numElements; i++) { + parts = s.split(":", 2); + int len = Integer.parseInt(parts[0]); + String key = null; + if (len > 0) key = parts[1].substring(0, len); + parts = parts[1].substring(len).split(":", 2); + len = Integer.parseInt(parts[0]); + String value = null; + if (len > 0) value = parts[1].substring(0, len); + s = parts[1].substring(len); + put(key, value); +} + } + + public StringableMap(Map m) { +super(m); + } + + @Override + public String toString() { +StringBuilder buf = new StringBuilder(); +buf.append(size()); +buf.append(':'); +if (size() > 0) { + for (Map.Entry entry : entrySet()) { +int length = (entry.getKey() == null) ? 0 : entry.getKey().length(); +buf.append(entry.getKey() == null ? 0 : length); +buf.append(':'); +if (length > 0) buf.append(entry.getKey()); +length = (entry.getValue() == null) ? 0 : entry.getValue().length(); +buf.append(length); +buf.append(':'); +if (length > 0) buf.append(entry.getValue()); + } +} +return buf.toString(); + } + + public Properties toProperties() { +Properties props = new Properties(); +props.putAll(this); +return props; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/185d9c57/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java -- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java index dd7054b..7a89a0c 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java @@ -37,9 +37,9 @@ import org.apache.commons.dbcp.PoolingDataSource; import org.apache.commons.pool.ObjectPool; import o
hive git commit: HIVE-13972 : Resolve class dependency issue introduced by HIVE-13354 (Wei Zheng, reviewed by Eugene Koifman)
Repository: hive Updated Branches: refs/heads/master f4707b1f1 -> edc5974a1 HIVE-13972 : Resolve class dependency issue introduced by HIVE-13354 (Wei Zheng, reviewed by Eugene Koifman) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/edc5974a Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/edc5974a Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/edc5974a Branch: refs/heads/master Commit: edc5974a1e87dc140850c6be09c4979c2ccae881 Parents: f4707b1 Author: Wei Zheng Authored: Wed Jun 8 13:25:20 2016 -0700 Committer: Wei Zheng Committed: Wed Jun 8 13:25:20 2016 -0700 -- .../hadoop/hive/common/StringableMap.java | 80 .../hadoop/hive/metastore/txn/TxnHandler.java | 2 +- .../hadoop/hive/metastore/txn/TxnUtils.java | 54 - .../hive/ql/txn/compactor/CompactorMR.java | 2 +- .../hive/ql/txn/compactor/TestWorker.java | 2 +- 5 files changed, 83 insertions(+), 57 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/edc5974a/common/src/java/org/apache/hadoop/hive/common/StringableMap.java -- diff --git a/common/src/java/org/apache/hadoop/hive/common/StringableMap.java b/common/src/java/org/apache/hadoop/hive/common/StringableMap.java new file mode 100644 index 000..8a93c0f --- /dev/null +++ b/common/src/java/org/apache/hadoop/hive/common/StringableMap.java @@ -0,0 +1,80 @@ +/** + * 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.common; + + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +/** + * A utility class that can convert a HashMap of Properties into a colon separated string, + * and can take the same format of string and convert it to a HashMap of Properties. + */ +public class StringableMap extends HashMap { + + public StringableMap(String s) { +String[] parts = s.split(":", 2); +// read that many chars +int numElements = Integer.parseInt(parts[0]); +s = parts[1]; +for (int i = 0; i < numElements; i++) { + parts = s.split(":", 2); + int len = Integer.parseInt(parts[0]); + String key = null; + if (len > 0) key = parts[1].substring(0, len); + parts = parts[1].substring(len).split(":", 2); + len = Integer.parseInt(parts[0]); + String value = null; + if (len > 0) value = parts[1].substring(0, len); + s = parts[1].substring(len); + put(key, value); +} + } + + public StringableMap(Map m) { +super(m); + } + + @Override + public String toString() { +StringBuilder buf = new StringBuilder(); +buf.append(size()); +buf.append(':'); +if (size() > 0) { + for (Map.Entry entry : entrySet()) { +int length = (entry.getKey() == null) ? 0 : entry.getKey().length(); +buf.append(entry.getKey() == null ? 0 : length); +buf.append(':'); +if (length > 0) buf.append(entry.getKey()); +length = (entry.getValue() == null) ? 0 : entry.getValue().length(); +buf.append(length); +buf.append(':'); +if (length > 0) buf.append(entry.getValue()); + } +} +return buf.toString(); + } + + public Properties toProperties() { +Properties props = new Properties(); +props.putAll(this); +return props; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/edc5974a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java -- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java index dd7054b..7a89a0c 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java @@ -37,9 +37,9 @@ import org.apache.commons.dbcp.PoolingDataSource; import org.apache.commons.pool.ObjectPool; import org.apach
hive git commit: Revert HIVE-13903 : getFunctionInfo should register jars under a check (Reviewed by Amareshwari)
Repository: hive Updated Branches: refs/heads/branch-2.1 4981c1b07 -> 1bc13cb36 Revert HIVE-13903 : getFunctionInfo should register jars under a check (Reviewed by Amareshwari) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/1bc13cb3 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/1bc13cb3 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/1bc13cb3 Branch: refs/heads/branch-2.1 Commit: 1bc13cb36aefb483d288f3eaceb107be55bafdde Parents: 4981c1b Author: Rajat Khandelwal Authored: Wed Jun 8 19:56:27 2016 +0100 Committer: Jesus Camacho Rodriguez Committed: Wed Jun 8 19:56:27 2016 +0100 -- ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/1bc13cb3/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java index 0d650fc..891514b 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java @@ -556,12 +556,7 @@ public class Registry { // and the current thread may not be able to resolve the UDF. Test for this condition // and if necessary load the JARs in this thread. if (isNative && info != null && info.isPersistent()) { - try { -info.getFunctionClass(); - } catch (Exception e) { -return registerToSessionRegistry(qualifiedName, info); - } - return info; + return registerToSessionRegistry(qualifiedName, info); } if (info != null || !isNative) { return info; // We have the UDF, or we are in the session registry (or both).
hive git commit: Revert HIVE-13903 : getFunctionInfo should register jars under a check (Reviewed by Amareshwari)
Repository: hive Updated Branches: refs/heads/master 148f35941 -> f4707b1f1 Revert HIVE-13903 : getFunctionInfo should register jars under a check (Reviewed by Amareshwari) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/f4707b1f Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f4707b1f Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f4707b1f Branch: refs/heads/master Commit: f4707b1f1e5e74d12366a2aa682f015becf3b96d Parents: 148f359 Author: Rajat Khandelwal Authored: Wed Jun 8 19:50:46 2016 +0100 Committer: Jesus Camacho Rodriguez Committed: Wed Jun 8 19:50:46 2016 +0100 -- ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/f4707b1f/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java index a89db68..86df74d 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java @@ -556,12 +556,7 @@ public class Registry { // and the current thread may not be able to resolve the UDF. Test for this condition // and if necessary load the JARs in this thread. if (isNative && info != null && info.isPersistent()) { - try { -info.getFunctionClass(); - } catch (Exception e) { -return registerToSessionRegistry(qualifiedName, info); - } - return info; + return registerToSessionRegistry(qualifiedName, info); } if (info != null || !isNative) { return info; // We have the UDF, or we are in the session registry (or both).
[1/2] hive git commit: HIVE-13248: Change date_add/date_sub/to_date functions to return Date type rather than String (Jason Dere, reviewed by Matt McCline)
Repository: hive Updated Branches: refs/heads/branch-2.1 39aaec264 -> 4981c1b07 http://git-wip-us.apache.org/repos/asf/hive/blob/4981c1b0/ql/src/test/results/clientpositive/union_offcbo.q.out -- diff --git a/ql/src/test/results/clientpositive/union_offcbo.q.out b/ql/src/test/results/clientpositive/union_offcbo.q.out index c71d53f..2c4c0de 100644 --- a/ql/src/test/results/clientpositive/union_offcbo.q.out +++ b/ql/src/test/results/clientpositive/union_offcbo.q.out @@ -60,7 +60,7 @@ POSTHOOK: Output: database:default POSTHOOK: Output: default@ttest2 PREHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -148,7 +148,7 @@ PREHOOK: query: explain SELECT PREHOOK: type: QUERY POSTHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -403,7 +403,7 @@ STAGE PLANS: PREHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -491,7 +491,7 @@ PREHOOK: query: explain SELECT PREHOOK: type: QUERY POSTHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -740,7 +740,7 @@ STAGE PLANS: PREHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -828,7 +828,7 @@ PREHOOK: query: explain SELECT PREHOOK: type: QUERY POSTHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -1083,7 +1083,7 @@ STAGE PLANS: PREHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -1171,7 +1171,7 @@ PREHOOK: query: explain SELECT PREHOOK: type: QUERY POSTHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -1426,7 +1426,7 @@ STAGE PLANS: PREHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash @@ -1514,7 +1514,7 @@ PREHOOK: query: explain SELECT PREHOOK: type: QUERY POSTHOOK: query: explain SELECT A2.id1, A2.sts,A2.at1, -CASE WHEN FLAG = 'A_INS' THEN date_add('2015-11-20', 1) ELSE '2015-11-20' END dt1 +CASE WHEN FLAG = 'A_INS' THEN cast(date_add('2015-11-20', 1) as string) ELSE '2015-11-20' END dt1 ,A2.dt2 ,A2.khash ,A2.rhash http://git-wip-us.apache.org/repos/asf/hive/blob/4981c1b0/ql/src/test/results/clientpositive/vectorized_date_funcs.q.out -- diff --git a/ql/src/test/results/clientpositive/vectorized_date_funcs.q.out b/ql/src/test/results/clientpositive/vectorized_date_funcs.q.out index b8023e2..299d3bc 100644 --- a/ql/src/test/results/clientpositive/vectorized_date_funcs.q.out +++ b/ql/src/test/results/clientpositive/vectorized_date_funcs.q.out @@ -243,7 +243,7 @@ STAGE PLANS: alias: date_udf_flight_orc Statistics: Num rows: 137 Data size: 13152 Basic stats: COMPLETE Column stats: NONE Select Operator - expressions: to_unix_timestamp(fl_time) (type: bigint), year(fl_time) (type: int), m
[2/2] hive git commit: HIVE-13248: Change date_add/date_sub/to_date functions to return Date type rather than String (Jason Dere, reviewed by Matt McCline)
HIVE-13248: Change date_add/date_sub/to_date functions to return Date type rather than String (Jason Dere, reviewed by Matt McCline) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4981c1b0 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4981c1b0 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4981c1b0 Branch: refs/heads/branch-2.1 Commit: 4981c1b07952f98f323419a4e2bfd73eeb269c66 Parents: 39aaec2 Author: Jason Dere Authored: Fri Jun 3 11:06:02 2016 -0700 Committer: Jason Dere Committed: Wed Jun 8 10:20:49 2016 -0700 -- .../org/apache/hive/common/util/DateParser.java | 31 + .../apache/hive/common/util/TestDateParser.java | 56 .../vector/expressions/CastStringToDate.java| 20 +-- .../expressions/VectorUDFDateAddColCol.java | 85 +--- .../expressions/VectorUDFDateAddColScalar.java | 78 --- .../expressions/VectorUDFDateAddScalarCol.java | 54 +++- .../vector/expressions/VectorUDFDateLong.java | 40 +- .../vector/expressions/VectorUDFDateString.java | 47 +++ .../expressions/VectorUDFDateTimestamp.java | 40 +- .../hive/ql/udf/generic/GenericUDFDate.java | 25 ++-- .../hive/ql/udf/generic/GenericUDFDateAdd.java | 32 +++-- .../hive/ql/udf/generic/GenericUDFDateSub.java | 127 +- .../expressions/TestVectorDateExpressions.java | 2 +- .../TestVectorGenericDateExpressions.java | 134 ++- .../hive/ql/udf/generic/TestGenericUDFDate.java | 14 +- .../ql/udf/generic/TestGenericUDFDateAdd.java | 10 +- .../ql/udf/generic/TestGenericUDFDateSub.java | 10 +- .../test/queries/clientpositive/union_offcbo.q | 10 +- .../clientpositive/fold_eq_with_case_when.q.out | 2 +- .../tez/vectorized_date_funcs.q.out | 26 ++-- ql/src/test/results/clientpositive/udf5.q.out | 4 +- ql/src/test/results/clientpositive/udf9.q.out | 2 +- .../results/clientpositive/union_offcbo.q.out | 20 +-- .../clientpositive/vectorized_date_funcs.q.out | 6 +- 24 files changed, 326 insertions(+), 549 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/4981c1b0/common/src/java/org/apache/hive/common/util/DateParser.java -- diff --git a/common/src/java/org/apache/hive/common/util/DateParser.java b/common/src/java/org/apache/hive/common/util/DateParser.java new file mode 100644 index 000..f6d1db3 --- /dev/null +++ b/common/src/java/org/apache/hive/common/util/DateParser.java @@ -0,0 +1,31 @@ +package org.apache.hive.common.util; + +import java.sql.Date; +import java.text.ParsePosition; +import java.text.SimpleDateFormat; + +/** + * Date parser class for Hive. + */ +public class DateParser { + SimpleDateFormat formatter = new SimpleDateFormat("-MM-dd"); + ParsePosition pos = new ParsePosition(0); + + public Date parseDate(String strValue) { +Date result = new Date(0); +if (parseDate(strValue, result)) { + return result; +} +return null; + } + + public boolean parseDate(String strValue, Date result) { +pos.setIndex(0); +java.util.Date parsedVal = formatter.parse(strValue, pos); +if (parsedVal == null) { + return false; +} +result.setTime(parsedVal.getTime()); +return true; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/4981c1b0/common/src/test/org/apache/hive/common/util/TestDateParser.java -- diff --git a/common/src/test/org/apache/hive/common/util/TestDateParser.java b/common/src/test/org/apache/hive/common/util/TestDateParser.java new file mode 100644 index 000..f33c9a1 --- /dev/null +++ b/common/src/test/org/apache/hive/common/util/TestDateParser.java @@ -0,0 +1,56 @@ +package org.apache.hive.common.util; + +import static org.junit.Assert.*; +import org.junit.Test; + +import java.sql.Date; + +public class TestDateParser { + DateParser parser = new DateParser(); + Date date = new Date(0); + + void checkValidCase(String strValue, Date expected) { +Date dateValue = parser.parseDate(strValue); +assertEquals(expected, dateValue); + +assertTrue(parser.parseDate(strValue, date)); +assertEquals(expected, date); + } + + void checkInvalidCase(String strValue) { +Date dateValue = parser.parseDate(strValue); +assertNull(dateValue); + +assertFalse(parser.parseDate(strValue, date)); + } + + @Test + public void testValidCases() throws Exception { +checkValidCase("1945-12-31", Date.valueOf("1945-12-31")); +checkValidCase("1946-01-01", Date.valueOf("1946-01-01")); +checkValidCase("2001-11-12", Date.valueOf("2001-11-12")); +checkValidCase("0004-05-06", Date.valueOf("0004-05-06")); +checkValidCase("1678-09-10",
hive git commit: HIVE-13955: Include service-rpc and llap-ext-client in packaging files (Jesus Camacho Rodriguez, reviewed by Sergey Shelukhin)
Repository: hive Updated Branches: refs/heads/branch-2.1 1c104626f -> 39aaec264 HIVE-13955: Include service-rpc and llap-ext-client in packaging files (Jesus Camacho Rodriguez, reviewed by Sergey Shelukhin) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/39aaec26 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/39aaec26 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/39aaec26 Branch: refs/heads/branch-2.1 Commit: 39aaec26462007881eb117d63fa258f43a6da871 Parents: 1c10462 Author: Jesus Camacho Rodriguez Authored: Wed Jun 8 13:26:04 2016 +0100 Committer: Jesus Camacho Rodriguez Committed: Wed Jun 8 13:26:04 2016 +0100 -- packaging/pom.xml | 5 + packaging/src/main/assembly/src.xml | 2 ++ 2 files changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hive/blob/39aaec26/packaging/pom.xml -- diff --git a/packaging/pom.xml b/packaging/pom.xml index 3270dfe..8244fec 100644 --- a/packaging/pom.xml +++ b/packaging/pom.xml @@ -225,6 +225,11 @@ org.apache.hive + hive-llap-ext-client + ${project.version} + + + org.apache.hive hive-hplsql ${project.version} http://git-wip-us.apache.org/repos/asf/hive/blob/39aaec26/packaging/src/main/assembly/src.xml -- diff --git a/packaging/src/main/assembly/src.xml b/packaging/src/main/assembly/src.xml index ba73bd5..f279112 100644 --- a/packaging/src/main/assembly/src.xml +++ b/packaging/src/main/assembly/src.xml @@ -79,6 +79,7 @@ metastore/**/* llap-common/**/* llap-client/**/* +llap-ext-client/**/* llap-tez/**/* llap-server/**/* lib/**/* @@ -89,6 +90,7 @@ pom.xml ql/**/* serde/**/* +service-rpc/**/* service/**/* shims/**/* spark-client/**/*
hive git commit: HIVE-13955: Include service-rpc and llap-ext-client in packaging files (Jesus Camacho Rodriguez, reviewed by Sergey Shelukhin)
Repository: hive Updated Branches: refs/heads/master 18c015a8b -> 148f35941 HIVE-13955: Include service-rpc and llap-ext-client in packaging files (Jesus Camacho Rodriguez, reviewed by Sergey Shelukhin) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/148f3594 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/148f3594 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/148f3594 Branch: refs/heads/master Commit: 148f35941897cd34ebd2b64845c8fa23256f9ff3 Parents: 18c015a Author: Jesus Camacho Rodriguez Authored: Wed Jun 8 13:25:17 2016 +0100 Committer: Jesus Camacho Rodriguez Committed: Wed Jun 8 13:25:17 2016 +0100 -- packaging/pom.xml | 5 + packaging/src/main/assembly/src.xml | 2 ++ 2 files changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hive/blob/148f3594/packaging/pom.xml -- diff --git a/packaging/pom.xml b/packaging/pom.xml index 6e5a396..679dfe8 100644 --- a/packaging/pom.xml +++ b/packaging/pom.xml @@ -225,6 +225,11 @@ org.apache.hive + hive-llap-ext-client + ${project.version} + + + org.apache.hive hive-hplsql ${project.version} http://git-wip-us.apache.org/repos/asf/hive/blob/148f3594/packaging/src/main/assembly/src.xml -- diff --git a/packaging/src/main/assembly/src.xml b/packaging/src/main/assembly/src.xml index ba73bd5..f279112 100644 --- a/packaging/src/main/assembly/src.xml +++ b/packaging/src/main/assembly/src.xml @@ -79,6 +79,7 @@ metastore/**/* llap-common/**/* llap-client/**/* +llap-ext-client/**/* llap-tez/**/* llap-server/**/* lib/**/* @@ -89,6 +90,7 @@ pom.xml ql/**/* serde/**/* +service-rpc/**/* service/**/* shims/**/* spark-client/**/*