hive git commit: HIVE-13341: Stats state is not captured correctly: differentiate load table and create table (Pengcheng Xiong, reviewed by Ashutosh Chauhan (addendum))
Repository: hive Updated Branches: refs/heads/master e087ba845 -> b8e086f5e HIVE-13341: Stats state is not captured correctly: differentiate load table and create table (Pengcheng Xiong, reviewed by Ashutosh Chauhan (addendum)) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b8e086f5 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b8e086f5 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b8e086f5 Branch: refs/heads/master Commit: b8e086f5eca0c2ab31b7b9f6486863d4abb5e84d Parents: e087ba8 Author: Pengcheng XiongAuthored: Tue May 10 17:33:00 2016 -0700 Committer: Pengcheng Xiong Committed: Tue May 10 17:33:00 2016 -0700 -- .../src/test/results/positive/external_table_ppd.q.out| 5 + .../results/positive/hbase_binary_storage_queries.q.out | 10 ++ 2 files changed, 15 insertions(+) -- http://git-wip-us.apache.org/repos/asf/hive/blob/b8e086f5/hbase-handler/src/test/results/positive/external_table_ppd.q.out -- diff --git a/hbase-handler/src/test/results/positive/external_table_ppd.q.out b/hbase-handler/src/test/results/positive/external_table_ppd.q.out index b9b3e8c..590906b 100644 --- a/hbase-handler/src/test/results/positive/external_table_ppd.q.out +++ b/hbase-handler/src/test/results/positive/external_table_ppd.q.out @@ -56,9 +56,14 @@ Retention: 0 A masked pattern was here Table Type:MANAGED_TABLE Table Parameters: + COLUMN_STATS_ACCURATE {\"BASIC_STATS\":\"true\"} hbase.table.default.storage.typebinary hbase.table.namet_hive + numFiles0 + numRows 0 + rawDataSize 0 storage_handler org.apache.hadoop.hive.hbase.HBaseStorageHandler + totalSize 0 A masked pattern was here # Storage Information http://git-wip-us.apache.org/repos/asf/hive/blob/b8e086f5/hbase-handler/src/test/results/positive/hbase_binary_storage_queries.q.out -- diff --git a/hbase-handler/src/test/results/positive/hbase_binary_storage_queries.q.out b/hbase-handler/src/test/results/positive/hbase_binary_storage_queries.q.out index 24df908..3d3e82d 100644 --- a/hbase-handler/src/test/results/positive/hbase_binary_storage_queries.q.out +++ b/hbase-handler/src/test/results/positive/hbase_binary_storage_queries.q.out @@ -56,9 +56,14 @@ Retention: 0 A masked pattern was here Table Type:MANAGED_TABLE Table Parameters: + COLUMN_STATS_ACCURATE {\"BASIC_STATS\":\"true\"} hbase.table.default.storage.typebinary hbase.table.namet_hive + numFiles0 + numRows 0 + rawDataSize 0 storage_handler org.apache.hadoop.hive.hbase.HBaseStorageHandler + totalSize 0 A masked pattern was here # Storage Information @@ -231,9 +236,14 @@ Retention: 0 A masked pattern was here Table Type:EXTERNAL_TABLE Table Parameters: + COLUMN_STATS_ACCURATE {\"BASIC_STATS\":\"true\"} EXTERNALTRUE hbase.table.namet_hive + numFiles0 + numRows 0 + rawDataSize 0 storage_handler org.apache.hadoop.hive.hbase.HBaseStorageHandler + totalSize 0 A masked pattern was here # Storage Information
hive git commit: HIVE-13342: Improve logging in llap decider and throw exception in case llap mode is all but we cannot run in llap. (Vikram Dixit K, reviewed by Sergey Shelukhin and Gunther Hagleitne
Repository: hive Updated Branches: refs/heads/master e3b6c9b1e -> e087ba845 HIVE-13342: Improve logging in llap decider and throw exception in case llap mode is all but we cannot run in llap. (Vikram Dixit K, reviewed by Sergey Shelukhin and Gunther Hagleitner) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/e087ba84 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/e087ba84 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/e087ba84 Branch: refs/heads/master Commit: e087ba84537555eb37b0047e7ace3f1b9dc06d08 Parents: e3b6c9b Author: vikramAuthored: Tue May 10 14:01:30 2016 -0700 Committer: vikram Committed: Tue May 10 14:03:29 2016 -0700 -- .../hive/ql/optimizer/physical/LlapDecider.java | 37 +++- ql/src/test/queries/clientpositive/llap_udf.q | 5 +++ .../results/clientpositive/llap/llap_udf.q.out | 2 -- 3 files changed, 34 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/e087ba84/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java index c0b7a32..e6f8f75 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/LlapDecider.java @@ -132,6 +132,12 @@ public class LlapDecider implements PhysicalPlanResolver { throws SemanticException { if (evaluateWork(tezWork, work)) { convertWork(tezWork, work); + } else { +if (mode == all) { + throw new SemanticException("Llap mode is set to all but cannot run work in llap mode." + + "Set " + HiveConf.ConfVars.LLAP_EXECUTION_MODE + " = auto or set " + + HiveConf.ConfVars.HIVE_EXECUTION_MODE + " = container"); +} } } @@ -228,6 +234,7 @@ public class LlapDecider implements PhysicalPlanResolver { } // couldn't convince you otherwise? well then let's llap. + LOG.info("Can run work " + work.getName() + " in llap mode."); return true; } @@ -304,6 +311,7 @@ public class LlapDecider implements PhysicalPlanResolver { @Override public Object process(Node n, Stack s, NodeProcessorCtx c, Object... os) { +LOG.debug("Cannot run operator [" + n + "] in llap mode."); return new Boolean(false); } }); @@ -313,7 +321,11 @@ public class LlapDecider implements PhysicalPlanResolver { public Object process(Node n, Stack s, NodeProcessorCtx c, Object... os) { ExprNodeDesc expr = ((FilterOperator)n).getConf().getPredicate(); -return new Boolean(checkExpression(expr)); +Boolean retval = new Boolean(checkExpression(expr)); +if (!retval) { + LOG.info("Cannot run filter operator [" + n + "] in llap mode"); +} +return new Boolean(retval); } }); opRules.put(new RuleRegExp("No user code in gby", GroupByOperator.getOperatorName() + "%"), @@ -321,9 +333,13 @@ public class LlapDecider implements PhysicalPlanResolver { @Override public Object process(Node n, Stack s, NodeProcessorCtx c, Object... os) { - @SuppressWarnings("unchecked") - List aggs = ((Operator) n).getConf().getAggregators(); -return new Boolean(checkAggregators(aggs)); +@SuppressWarnings("unchecked") +List aggs = ((Operator) n).getConf().getAggregators(); +Boolean retval = new Boolean(checkAggregators(aggs)); +if (!retval) { + LOG.info("Cannot run group by operator [" + n + "] in llap mode"); +} +return new Boolean(retval); } }); opRules.put(new RuleRegExp("No user code in select", SelectOperator.getOperatorName() + "%"), @@ -331,9 +347,13 @@ public class LlapDecider implements PhysicalPlanResolver { @Override public Object process(Node n, Stack s, NodeProcessorCtx c, Object... os) { - @SuppressWarnings({ "unchecked" }) - List exprs = ((Operator) n).getConf().getColList(); -return new Boolean(checkExpressions(exprs)); +@SuppressWarnings({ "unchecked" }) +List exprs = ((Operator) n).getConf().getColList(); +Boolean retval = new Boolean(checkExpressions(exprs)); +if (!retval) { + LOG.info("Cannot run
hive git commit: HIVE-13642: Update GUESS_FIELDS option in .reviewboardrc to support current version of RBTools. (Takuma Wakamori, reviewed by Jesus Camacho Rodriguez)
Repository: hive Updated Branches: refs/heads/master 0ea9d35de -> e3b6c9b1e HIVE-13642: Update GUESS_FIELDS option in .reviewboardrc to support current version of RBTools. (Takuma Wakamori, reviewed by Jesus Camacho Rodriguez) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/e3b6c9b1 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/e3b6c9b1 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/e3b6c9b1 Branch: refs/heads/master Commit: e3b6c9b1e33f253249f125734159105bae7f4ea7 Parents: 0ea9d35 Author: Takuma WakamoriAuthored: Tue May 10 20:14:38 2016 +0100 Committer: Jesus Camacho Rodriguez Committed: Tue May 10 20:14:38 2016 +0100 -- .reviewboardrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/e3b6c9b1/.reviewboardrc -- diff --git a/.reviewboardrc b/.reviewboardrc index abc33f9..4923167 100644 --- a/.reviewboardrc +++ b/.reviewboardrc @@ -30,4 +30,4 @@ REPOSITORY='hive-git' REVIEWBOARD_URL='https://reviews.apache.org' TRACKING_BRANCH='origin/master' TARGET_GROUPS='hive' -GUESS_FIELDS='true' +GUESS_FIELDS='yes'
[3/8] hive git commit: HIVE-12634 : Add command to kill an ACID transacton (Wei Zheng, reviewed by Eugene Koifman)
http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php -- diff --git a/metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php b/metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php index 6154d8c..438e368 100644 --- a/metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php +++ b/metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php @@ -948,6 +948,11 @@ interface ThriftHiveMetastoreIf extends \FacebookServiceIf { */ public function abort_txn(\metastore\AbortTxnRequest $rqst); /** + * @param \metastore\AbortTxnsRequest $rqst + * @throws \metastore\NoSuchTxnException + */ + public function abort_txns(\metastore\AbortTxnsRequest $rqst); + /** * @param \metastore\CommitTxnRequest $rqst * @throws \metastore\NoSuchTxnException * @throws \metastore\TxnAbortedException @@ -7532,6 +7537,57 @@ class ThriftHiveMetastoreClient extends \FacebookServiceClient implements \metas return; } + public function abort_txns(\metastore\AbortTxnsRequest $rqst) + { +$this->send_abort_txns($rqst); +$this->recv_abort_txns(); + } + + public function send_abort_txns(\metastore\AbortTxnsRequest $rqst) + { +$args = new \metastore\ThriftHiveMetastore_abort_txns_args(); +$args->rqst = $rqst; +$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); +if ($bin_accel) +{ + thrift_protocol_write_binary($this->output_, 'abort_txns', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); +} +else +{ + $this->output_->writeMessageBegin('abort_txns', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); +} + } + + public function recv_abort_txns() + { +$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); +if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\metastore\ThriftHiveMetastore_abort_txns_result', $this->input_->isStrictRead()); +else +{ + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { +$x = new TApplicationException(); +$x->read($this->input_); +$this->input_->readMessageEnd(); +throw $x; + } + $result = new \metastore\ThriftHiveMetastore_abort_txns_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); +} +if ($result->o1 !== null) { + throw $result->o1; +} +return; + } + public function commit_txn(\metastore\CommitTxnRequest $rqst) { $this->send_commit_txn($rqst); @@ -9372,14 +9428,14 @@ class ThriftHiveMetastore_get_databases_result { case 0: if ($ftype == TType::LST) { $this->success = array(); -$_size472 = 0; -$_etype475 = 0; -$xfer += $input->readListBegin($_etype475, $_size472); -for ($_i476 = 0; $_i476 < $_size472; ++$_i476) +$_size479 = 0; +$_etype482 = 0; +$xfer += $input->readListBegin($_etype482, $_size479); +for ($_i483 = 0; $_i483 < $_size479; ++$_i483) { - $elem477 = null; - $xfer += $input->readString($elem477); - $this->success []= $elem477; + $elem484 = null; + $xfer += $input->readString($elem484); + $this->success []= $elem484; } $xfer += $input->readListEnd(); } else { @@ -9415,9 +9471,9 @@ class ThriftHiveMetastore_get_databases_result { { $output->writeListBegin(TType::STRING, count($this->success)); { - foreach ($this->success as $iter478) + foreach ($this->success as $iter485) { -$xfer += $output->writeString($iter478); +$xfer += $output->writeString($iter485); } } $output->writeListEnd(); @@ -9548,14 +9604,14 @@ class ThriftHiveMetastore_get_all_databases_result { case 0: if ($ftype == TType::LST) { $this->success = array(); -$_size479 = 0; -$_etype482 = 0; -$xfer += $input->readListBegin($_etype482, $_size479); -for ($_i483 = 0; $_i483 < $_size479; ++$_i483) +$_size486 = 0; +$_etype489 = 0; +$xfer += $input->readListBegin($_etype489, $_size486); +for ($_i490 = 0; $_i490 < $_size486; ++$_i490) { - $elem484 = null; - $xfer += $input->readString($elem484); -
[8/8] hive git commit: HIVE-12634 : Add command to kill an ACID transacton (Wei Zheng, reviewed by Eugene Koifman)
HIVE-12634 : Add command to kill an ACID transacton (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/aecb0c02 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/aecb0c02 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/aecb0c02 Branch: refs/heads/branch-1 Commit: aecb0c02eaf7b2ee5e448c3aaa8bda1274de78cf Parents: f1950fc Author: Wei ZhengAuthored: Tue May 10 11:05:30 2016 -0700 Committer: Wei Zheng Committed: Tue May 10 11:05:30 2016 -0700 -- .../apache/hadoop/hive/common/JavaUtils.java|5 + metastore/if/hive_metastore.thrift |5 + .../gen/thrift/gen-cpp/ThriftHiveMetastore.cpp | 2195 ++- .../gen/thrift/gen-cpp/ThriftHiveMetastore.h| 125 + .../ThriftHiveMetastore_server.skeleton.cpp |5 + .../gen/thrift/gen-cpp/hive_metastore_types.cpp | 1060 +++--- .../gen/thrift/gen-cpp/hive_metastore_types.h | 42 + .../hive/metastore/api/AbortTxnsRequest.java| 438 +++ .../metastore/api/AddDynamicPartitions.java | 32 +- .../hive/metastore/api/FireEventRequest.java| 32 +- .../metastore/api/GetAllFunctionsResponse.java | 36 +- .../api/HeartbeatTxnRangeResponse.java | 64 +- .../metastore/api/InsertEventRequestData.java | 32 +- .../hadoop/hive/metastore/api/LockRequest.java | 36 +- .../api/NotificationEventResponse.java | 36 +- .../hive/metastore/api/ShowCompactResponse.java | 36 +- .../hive/metastore/api/ShowLocksResponse.java | 36 +- .../hive/metastore/api/ThriftHiveMetastore.java | 3588 +++--- .../gen-php/metastore/ThriftHiveMetastore.php | 1311 --- .../src/gen/thrift/gen-php/metastore/Types.php | 307 +- .../hive_metastore/ThriftHiveMetastore-remote |7 + .../hive_metastore/ThriftHiveMetastore.py | 931 +++-- .../gen/thrift/gen-py/hive_metastore/ttypes.py | 205 +- .../gen/thrift/gen-rb/hive_metastore_types.rb | 17 + .../gen/thrift/gen-rb/thrift_hive_metastore.rb | 58 + .../hadoop/hive/metastore/HiveMetaStore.java|6 + .../hive/metastore/HiveMetaStoreClient.java |6 + .../hadoop/hive/metastore/IMetaStoreClient.java |6 + .../hadoop/hive/metastore/txn/TxnHandler.java | 69 +- .../hadoop/hive/metastore/txn/TxnStore.java |9 + .../org/apache/hadoop/hive/ql/exec/DDLTask.java | 13 +- .../apache/hadoop/hive/ql/metadata/Hive.java|9 + .../hive/ql/parse/DDLSemanticAnalyzer.java | 19 + .../org/apache/hadoop/hive/ql/parse/HiveLexer.g |1 + .../apache/hadoop/hive/ql/parse/HiveParser.g| 11 + .../hadoop/hive/ql/parse/IdentifiersParser.g|2 +- .../hive/ql/parse/SemanticAnalyzerFactory.java |2 + .../hadoop/hive/ql/plan/AbortTxnsDesc.java | 36 + .../org/apache/hadoop/hive/ql/plan/DDLWork.java | 16 + .../hadoop/hive/ql/plan/HiveOperation.java |4 +- .../authorization/plugin/HiveOperationType.java |1 + .../plugin/sqlstd/Operation2Privilege.java |3 +- .../queries/clientpositive/dbtxnmgr_abort.q |6 + .../results/clientpositive/dbtxnmgr_abort.q.out |8 + 44 files changed, 6842 insertions(+), 4024 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/common/src/java/org/apache/hadoop/hive/common/JavaUtils.java -- diff --git a/common/src/java/org/apache/hadoop/hive/common/JavaUtils.java b/common/src/java/org/apache/hadoop/hive/common/JavaUtils.java index dc3a4ae..5bdf6f4 100644 --- a/common/src/java/org/apache/hadoop/hive/common/JavaUtils.java +++ b/common/src/java/org/apache/hadoop/hive/common/JavaUtils.java @@ -26,6 +26,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URLClassLoader; import java.util.Arrays; +import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -151,6 +152,10 @@ public final class JavaUtils { return "txnid:" + txnId; } + public static String txnIdsToString(List txnIds) { +return "Transactions requested to be aborted: " + txnIds.toString(); + } + private JavaUtils() { // prevent instantiation } http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/metastore/if/hive_metastore.thrift -- diff --git a/metastore/if/hive_metastore.thrift b/metastore/if/hive_metastore.thrift index f84b2a9..4b5d207 100755 --- a/metastore/if/hive_metastore.thrift +++ b/metastore/if/hive_metastore.thrift @@ -573,6 +573,10 @@ struct AbortTxnRequest { 1: required i64 txnid, } +struct AbortTxnsRequest { +1: required list txn_ids, +} + struct CommitTxnRequest
[4/8] hive git commit: HIVE-12634 : Add command to kill an ACID transacton (Wei Zheng, reviewed by Eugene Koifman)
http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java -- diff --git a/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java b/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java index bc417ef..e836154 100644 --- a/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java +++ b/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java @@ -266,6 +266,8 @@ public class ThriftHiveMetastore { public void abort_txn(AbortTxnRequest rqst) throws NoSuchTxnException, org.apache.thrift.TException; +public void abort_txns(AbortTxnsRequest rqst) throws NoSuchTxnException, org.apache.thrift.TException; + public void commit_txn(CommitTxnRequest rqst) throws NoSuchTxnException, TxnAbortedException, org.apache.thrift.TException; public LockResponse lock(LockRequest rqst) throws NoSuchTxnException, TxnAbortedException, org.apache.thrift.TException; @@ -520,6 +522,8 @@ public class ThriftHiveMetastore { public void abort_txn(AbortTxnRequest rqst, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; +public void abort_txns(AbortTxnsRequest rqst, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void commit_txn(CommitTxnRequest rqst, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void lock(LockRequest rqst, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -3937,6 +3941,29 @@ public class ThriftHiveMetastore { return; } +public void abort_txns(AbortTxnsRequest rqst) throws NoSuchTxnException, org.apache.thrift.TException +{ + send_abort_txns(rqst); + recv_abort_txns(); +} + +public void send_abort_txns(AbortTxnsRequest rqst) throws org.apache.thrift.TException +{ + abort_txns_args args = new abort_txns_args(); + args.setRqst(rqst); + sendBase("abort_txns", args); +} + +public void recv_abort_txns() throws NoSuchTxnException, org.apache.thrift.TException +{ + abort_txns_result result = new abort_txns_result(); + receiveBase(result, "abort_txns"); + if (result.o1 != null) { +throw result.o1; + } + return; +} + public void commit_txn(CommitTxnRequest rqst) throws NoSuchTxnException, TxnAbortedException, org.apache.thrift.TException { send_commit_txn(rqst); @@ -8326,6 +8353,38 @@ public class ThriftHiveMetastore { } } +public void abort_txns(AbortTxnsRequest rqst, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + abort_txns_call method_call = new abort_txns_call(rqst, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); +} + +public static class abort_txns_call extends org.apache.thrift.async.TAsyncMethodCall { + private AbortTxnsRequest rqst; + public abort_txns_call(AbortTxnsRequest rqst, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { +super(client, protocolFactory, transport, resultHandler, false); +this.rqst = rqst; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { +prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("abort_txns", org.apache.thrift.protocol.TMessageType.CALL, 0)); +abort_txns_args args = new abort_txns_args(); +args.setRqst(rqst); +args.write(prot); +prot.writeMessageEnd(); + } + + public void getResult() throws NoSuchTxnException, org.apache.thrift.TException { +if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); +} +org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); +org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); +(new Client(prot)).recv_abort_txns(); + } +} + public void commit_txn(CommitTxnRequest rqst, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
[6/8] hive git commit: HIVE-12634 : Add command to kill an ACID transacton (Wei Zheng, reviewed by Eugene Koifman)
http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h -- diff --git a/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h b/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h index a7f17cd..64b06c4 100644 --- a/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h +++ b/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h @@ -134,6 +134,7 @@ class ThriftHiveMetastoreIf : virtual public ::facebook::fb303::FacebookService virtual void get_open_txns_info(GetOpenTxnsInfoResponse& _return) = 0; virtual void open_txns(OpenTxnsResponse& _return, const OpenTxnRequest& rqst) = 0; virtual void abort_txn(const AbortTxnRequest& rqst) = 0; + virtual void abort_txns(const AbortTxnsRequest& rqst) = 0; virtual void commit_txn(const CommitTxnRequest& rqst) = 0; virtual void lock(LockResponse& _return, const LockRequest& rqst) = 0; virtual void check_lock(LockResponse& _return, const CheckLockRequest& rqst) = 0; @@ -535,6 +536,9 @@ class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual p void abort_txn(const AbortTxnRequest& /* rqst */) { return; } + void abort_txns(const AbortTxnsRequest& /* rqst */) { +return; + } void commit_txn(const CommitTxnRequest& /* rqst */) { return; } @@ -14981,6 +14985,110 @@ class ThriftHiveMetastore_abort_txn_presult { }; +typedef struct _ThriftHiveMetastore_abort_txns_args__isset { + _ThriftHiveMetastore_abort_txns_args__isset() : rqst(false) {} + bool rqst :1; +} _ThriftHiveMetastore_abort_txns_args__isset; + +class ThriftHiveMetastore_abort_txns_args { + public: + + ThriftHiveMetastore_abort_txns_args(const ThriftHiveMetastore_abort_txns_args&); + ThriftHiveMetastore_abort_txns_args& operator=(const ThriftHiveMetastore_abort_txns_args&); + ThriftHiveMetastore_abort_txns_args() { + } + + virtual ~ThriftHiveMetastore_abort_txns_args() throw(); + AbortTxnsRequest rqst; + + _ThriftHiveMetastore_abort_txns_args__isset __isset; + + void __set_rqst(const AbortTxnsRequest& val); + + bool operator == (const ThriftHiveMetastore_abort_txns_args & rhs) const + { +if (!(rqst == rhs.rqst)) + return false; +return true; + } + bool operator != (const ThriftHiveMetastore_abort_txns_args ) const { +return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_abort_txns_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class ThriftHiveMetastore_abort_txns_pargs { + public: + + + virtual ~ThriftHiveMetastore_abort_txns_pargs() throw(); + const AbortTxnsRequest* rqst; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_abort_txns_result__isset { + _ThriftHiveMetastore_abort_txns_result__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_abort_txns_result__isset; + +class ThriftHiveMetastore_abort_txns_result { + public: + + ThriftHiveMetastore_abort_txns_result(const ThriftHiveMetastore_abort_txns_result&); + ThriftHiveMetastore_abort_txns_result& operator=(const ThriftHiveMetastore_abort_txns_result&); + ThriftHiveMetastore_abort_txns_result() { + } + + virtual ~ThriftHiveMetastore_abort_txns_result() throw(); + NoSuchTxnException o1; + + _ThriftHiveMetastore_abort_txns_result__isset __isset; + + void __set_o1(const NoSuchTxnException& val); + + bool operator == (const ThriftHiveMetastore_abort_txns_result & rhs) const + { +if (!(o1 == rhs.o1)) + return false; +return true; + } + bool operator != (const ThriftHiveMetastore_abort_txns_result ) const { +return !(*this == rhs); + } + + bool operator < (const ThriftHiveMetastore_abort_txns_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ThriftHiveMetastore_abort_txns_presult__isset { + _ThriftHiveMetastore_abort_txns_presult__isset() : o1(false) {} + bool o1 :1; +} _ThriftHiveMetastore_abort_txns_presult__isset; + +class ThriftHiveMetastore_abort_txns_presult { + public: + + + virtual ~ThriftHiveMetastore_abort_txns_presult() throw(); + NoSuchTxnException o1; + + _ThriftHiveMetastore_abort_txns_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + typedef struct _ThriftHiveMetastore_commit_txn_args__isset { _ThriftHiveMetastore_commit_txn_args__isset() : rqst(false) {} bool rqst :1; @@ -16730,6 +16838,9 @@ class ThriftHiveMetastoreClient : virtual public ThriftHiveMetastoreIf, public void abort_txn(const AbortTxnRequest& rqst); void send_abort_txn(const AbortTxnRequest& rqst); void recv_abort_txn(); + void abort_txns(const AbortTxnsRequest& rqst); + void send_abort_txns(const
[2/8] hive git commit: HIVE-12634 : Add command to kill an ACID transacton (Wei Zheng, reviewed by Eugene Koifman)
http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/metastore/src/gen/thrift/gen-php/metastore/Types.php -- diff --git a/metastore/src/gen/thrift/gen-php/metastore/Types.php b/metastore/src/gen/thrift/gen-php/metastore/Types.php index 4fc2da6..fe25366 100644 --- a/metastore/src/gen/thrift/gen-php/metastore/Types.php +++ b/metastore/src/gen/thrift/gen-php/metastore/Types.php @@ -10850,6 +10850,107 @@ class AbortTxnRequest { } +class AbortTxnsRequest { + static $_TSPEC; + + /** + * @var int[] + */ + public $txn_ids = null; + + public function __construct($vals=null) { +if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( +1 => array( + 'var' => 'txn_ids', + 'type' => TType::LST, + 'etype' => TType::I64, + 'elem' => array( +'type' => TType::I64, +), + ), +); +} +if (is_array($vals)) { + if (isset($vals['txn_ids'])) { +$this->txn_ids = $vals['txn_ids']; + } +} + } + + public function getName() { +return 'AbortTxnsRequest'; + } + + public function read($input) + { +$xfer = 0; +$fname = null; +$ftype = 0; +$fid = 0; +$xfer += $input->readStructBegin($fname); +while (true) +{ + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { +break; + } + switch ($fid) + { +case 1: + if ($ftype == TType::LST) { +$this->txn_ids = array(); +$_size400 = 0; +$_etype403 = 0; +$xfer += $input->readListBegin($_etype403, $_size400); +for ($_i404 = 0; $_i404 < $_size400; ++$_i404) +{ + $elem405 = null; + $xfer += $input->readI64($elem405); + $this->txn_ids []= $elem405; +} +$xfer += $input->readListEnd(); + } else { +$xfer += $input->skip($ftype); + } + break; +default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); +} +$xfer += $input->readStructEnd(); +return $xfer; + } + + public function write($output) { +$xfer = 0; +$xfer += $output->writeStructBegin('AbortTxnsRequest'); +if ($this->txn_ids !== null) { + if (!is_array($this->txn_ids)) { +throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('txn_ids', TType::LST, 1); + { +$output->writeListBegin(TType::I64, count($this->txn_ids)); +{ + foreach ($this->txn_ids as $iter406) + { +$xfer += $output->writeI64($iter406); + } +} +$output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); +} +$xfer += $output->writeFieldStop(); +$xfer += $output->writeStructEnd(); +return $xfer; + } + +} + class CommitTxnRequest { static $_TSPEC; @@ -11187,15 +11288,15 @@ class LockRequest { case 1: if ($ftype == TType::LST) { $this->component = array(); -$_size400 = 0; -$_etype403 = 0; -$xfer += $input->readListBegin($_etype403, $_size400); -for ($_i404 = 0; $_i404 < $_size400; ++$_i404) +$_size407 = 0; +$_etype410 = 0; +$xfer += $input->readListBegin($_etype410, $_size407); +for ($_i411 = 0; $_i411 < $_size407; ++$_i411) { - $elem405 = null; - $elem405 = new \metastore\LockComponent(); - $xfer += $elem405->read($input); - $this->component []= $elem405; + $elem412 = null; + $elem412 = new \metastore\LockComponent(); + $xfer += $elem412->read($input); + $this->component []= $elem412; } $xfer += $input->readListEnd(); } else { @@ -11251,9 +11352,9 @@ class LockRequest { { $output->writeListBegin(TType::STRUCT, count($this->component)); { - foreach ($this->component as $iter406) + foreach ($this->component as $iter413) { -$xfer += $iter406->write($output); +$xfer += $iter413->write($output); } } $output->writeListEnd(); @@ -12196,15 +12297,15 @@ class ShowLocksResponse { case 1: if ($ftype == TType::LST) { $this->locks = array(); -$_size407 = 0; -$_etype410 = 0; -$xfer += $input->readListBegin($_etype410, $_size407); -for ($_i411 = 0; $_i411 < $_size407; ++$_i411) +$_size414 = 0; +$_etype417 = 0; +$xfer += $input->readListBegin($_etype417, $_size414); +for ($_i418 = 0; $_i418 < $_size414;
[7/8] hive git commit: HIVE-12634 : Add command to kill an ACID transacton (Wei Zheng, reviewed by Eugene Koifman)
http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp -- diff --git a/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp b/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp index 5efda4f..176b634 100644 --- a/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp +++ b/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp @@ -1240,14 +1240,14 @@ uint32_t ThriftHiveMetastore_get_databases_result::read(::apache::thrift::protoc if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); -uint32_t _size649; -::apache::thrift::protocol::TType _etype652; -xfer += iprot->readListBegin(_etype652, _size649); -this->success.resize(_size649); -uint32_t _i653; -for (_i653 = 0; _i653 < _size649; ++_i653) +uint32_t _size657; +::apache::thrift::protocol::TType _etype660; +xfer += iprot->readListBegin(_etype660, _size657); +this->success.resize(_size657); +uint32_t _i661; +for (_i661 = 0; _i661 < _size657; ++_i661) { - xfer += iprot->readString(this->success[_i653]); + xfer += iprot->readString(this->success[_i661]); } xfer += iprot->readListEnd(); } @@ -1286,10 +1286,10 @@ uint32_t ThriftHiveMetastore_get_databases_result::write(::apache::thrift::proto xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::vector ::const_iterator _iter654; - for (_iter654 = this->success.begin(); _iter654 != this->success.end(); ++_iter654) + std::vector ::const_iterator _iter662; + for (_iter662 = this->success.begin(); _iter662 != this->success.end(); ++_iter662) { -xfer += oprot->writeString((*_iter654)); +xfer += oprot->writeString((*_iter662)); } xfer += oprot->writeListEnd(); } @@ -1334,14 +1334,14 @@ uint32_t ThriftHiveMetastore_get_databases_presult::read(::apache::thrift::proto if (ftype == ::apache::thrift::protocol::T_LIST) { { (*(this->success)).clear(); -uint32_t _size655; -::apache::thrift::protocol::TType _etype658; -xfer += iprot->readListBegin(_etype658, _size655); -(*(this->success)).resize(_size655); -uint32_t _i659; -for (_i659 = 0; _i659 < _size655; ++_i659) +uint32_t _size663; +::apache::thrift::protocol::TType _etype666; +xfer += iprot->readListBegin(_etype666, _size663); +(*(this->success)).resize(_size663); +uint32_t _i667; +for (_i667 = 0; _i667 < _size663; ++_i667) { - xfer += iprot->readString((*(this->success))[_i659]); + xfer += iprot->readString((*(this->success))[_i667]); } xfer += iprot->readListEnd(); } @@ -1458,14 +1458,14 @@ uint32_t ThriftHiveMetastore_get_all_databases_result::read(::apache::thrift::pr if (ftype == ::apache::thrift::protocol::T_LIST) { { this->success.clear(); -uint32_t _size660; -::apache::thrift::protocol::TType _etype663; -xfer += iprot->readListBegin(_etype663, _size660); -this->success.resize(_size660); -uint32_t _i664; -for (_i664 = 0; _i664 < _size660; ++_i664) +uint32_t _size668; +::apache::thrift::protocol::TType _etype671; +xfer += iprot->readListBegin(_etype671, _size668); +this->success.resize(_size668); +uint32_t _i672; +for (_i672 = 0; _i672 < _size668; ++_i672) { - xfer += iprot->readString(this->success[_i664]); + xfer += iprot->readString(this->success[_i672]); } xfer += iprot->readListEnd(); } @@ -1504,10 +1504,10 @@ uint32_t ThriftHiveMetastore_get_all_databases_result::write(::apache::thrift::p xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); { xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->success.size())); - std::vector ::const_iterator _iter665; - for (_iter665 = this->success.begin(); _iter665 != this->success.end(); ++_iter665) + std::vector ::const_iterator _iter673; + for (_iter673 = this->success.begin(); _iter673 != this->success.end(); ++_iter673) { -xfer += oprot->writeString((*_iter665)); +xfer += oprot->writeString((*_iter673)); } xfer += oprot->writeListEnd(); } @@
[1/8] hive git commit: HIVE-12634 : Add command to kill an ACID transacton (Wei Zheng, reviewed by Eugene Koifman)
Repository: hive Updated Branches: refs/heads/branch-1 f1950fc8a -> aecb0c02e http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py -- diff --git a/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py b/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py index 596fdf5..c59fa3e 100644 --- a/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py +++ b/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py @@ -7483,6 +7483,81 @@ class AbortTxnRequest: def __ne__(self, other): return not (self == other) +class AbortTxnsRequest: + """ + Attributes: + - txn_ids + """ + + thrift_spec = ( +None, # 0 +(1, TType.LIST, 'txn_ids', (TType.I64,None), None, ), # 1 + ) + + def __init__(self, txn_ids=None,): +self.txn_ids = txn_ids + + def read(self, iprot): +if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return +iprot.readStructBegin() +while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: +break + if fid == 1: +if ftype == TType.LIST: + self.txn_ids = [] + (_etype402, _size399) = iprot.readListBegin() + for _i403 in xrange(_size399): +_elem404 = iprot.readI64() +self.txn_ids.append(_elem404) + iprot.readListEnd() +else: + iprot.skip(ftype) + else: +iprot.skip(ftype) + iprot.readFieldEnd() +iprot.readStructEnd() + + def write(self, oprot): +if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return +oprot.writeStructBegin('AbortTxnsRequest') +if self.txn_ids is not None: + oprot.writeFieldBegin('txn_ids', TType.LIST, 1) + oprot.writeListBegin(TType.I64, len(self.txn_ids)) + for iter405 in self.txn_ids: +oprot.writeI64(iter405) + oprot.writeListEnd() + oprot.writeFieldEnd() +oprot.writeFieldStop() +oprot.writeStructEnd() + + def validate(self): +if self.txn_ids is None: + raise TProtocol.TProtocolException(message='Required field txn_ids is unset!') +return + + + def __hash__(self): +value = 17 +value = (value * 31) ^ hash(self.txn_ids) +return value + + def __repr__(self): +L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] +return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): +return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): +return not (self == other) + class CommitTxnRequest: """ Attributes: @@ -7711,11 +7786,11 @@ class LockRequest: if fid == 1: if ftype == TType.LIST: self.component = [] - (_etype402, _size399) = iprot.readListBegin() - for _i403 in xrange(_size399): -_elem404 = LockComponent() -_elem404.read(iprot) -self.component.append(_elem404) + (_etype409, _size406) = iprot.readListBegin() + for _i410 in xrange(_size406): +_elem411 = LockComponent() +_elem411.read(iprot) +self.component.append(_elem411) iprot.readListEnd() else: iprot.skip(ftype) @@ -7752,8 +7827,8 @@ class LockRequest: if self.component is not None: oprot.writeFieldBegin('component', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.component)) - for iter405 in self.component: -iter405.write(oprot) + for iter412 in self.component: +iter412.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.txnid is not None: @@ -8451,11 +8526,11 @@ class ShowLocksResponse: if fid == 1: if ftype == TType.LIST: self.locks = [] - (_etype409, _size406) = iprot.readListBegin() - for _i410 in xrange(_size406): -_elem411 = ShowLocksResponseElement() -_elem411.read(iprot) -self.locks.append(_elem411) + (_etype416, _size413) = iprot.readListBegin() + for _i417 in xrange(_size413): +_elem418 = ShowLocksResponseElement() +_elem418.read(iprot) +self.locks.append(_elem418) iprot.readListEnd() else: iprot.skip(ftype) @@ -8472,8 +8547,8 @@ class ShowLocksResponse: if self.locks is not None: oprot.writeFieldBegin('locks', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT,
[5/8] hive git commit: HIVE-12634 : Add command to kill an ACID transacton (Wei Zheng, reviewed by Eugene Koifman)
http://git-wip-us.apache.org/repos/asf/hive/blob/aecb0c02/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/AbortTxnsRequest.java -- diff --git a/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/AbortTxnsRequest.java b/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/AbortTxnsRequest.java new file mode 100644 index 000..1bf4655 --- /dev/null +++ b/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/AbortTxnsRequest.java @@ -0,0 +1,438 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.metastore.api; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +public class AbortTxnsRequest implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AbortTxnsRequest"); + + private static final org.apache.thrift.protocol.TField TXN_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("txn_ids", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final Map schemes = new HashMap (); + static { +schemes.put(StandardScheme.class, new AbortTxnsRequestStandardSchemeFactory()); +schemes.put(TupleScheme.class, new AbortTxnsRequestTupleSchemeFactory()); + } + + private List txn_ids; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +TXN_IDS((short)1, "txn_ids"); + +private static final Map byName = new HashMap (); + +static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { +byName.put(field.getFieldName(), field); + } +} + +/** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ +public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { +case 1: // TXN_IDS + return TXN_IDS; +default: + return null; + } +} + +/** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ +public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; +} + +/** + * Find the _Fields constant that matches name, or null if its not found. + */ +public static _Fields findByName(String name) { + return byName.get(name); +} + +private final short _thriftId; +private final String _fieldName; + +_Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; +} + +public short getThriftFieldId() { + return _thriftId; +} + +public String getFieldName() { + return _fieldName; +} + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { +Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); +tmpMap.put(_Fields.TXN_IDS, new org.apache.thrift.meta_data.FieldMetaData("txn_ids", org.apache.thrift.TFieldRequirementType.REQUIRED, +new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, +new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64; +metaDataMap = Collections.unmodifiableMap(tmpMap); +
hive git commit: HIVE-13676 : Tests failing because metastore doesn't come up (Rajat Khandelwal via Ashutosh Chauhan)
Repository: hive Updated Branches: refs/heads/master 882a7f000 -> 0ea9d35de HIVE-13676 : Tests failing because metastore doesn't come up (Rajat Khandelwal via Ashutosh Chauhan) Signed-off-by: Ashutosh ChauhanProject: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/0ea9d35d Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0ea9d35d Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0ea9d35d Branch: refs/heads/master Commit: 0ea9d35de39df94cb7c7ff4274c7ea4b177ba489 Parents: 882a7f0 Author: Rajat Khandelwal Authored: Tue May 10 01:32:00 2016 -0800 Committer: Ashutosh Chauhan Committed: Tue May 10 09:47:31 2016 -0700 -- .../mapreduce/TestHCatMultiOutputFormat.java| 27 +++ .../hive/hcatalog/api/TestHCatClient.java | 49 .../hive/metastore/TestMarkPartitionRemote.java | 26 +-- .../hadoop/hive/metastore/MetaStoreUtils.java | 26 +-- .../metastore/TestHiveMetaStoreGetMetaConf.java | 23 ++--- .../TestHiveMetaStorePartitionSpecs.java| 22 ++--- .../hadoop/hive/ql/metadata/TestHiveRemote.java | 34 +- 7 files changed, 48 insertions(+), 159 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/0ea9d35d/hcatalog/core/src/test/java/org/apache/hive/hcatalog/mapreduce/TestHCatMultiOutputFormat.java -- diff --git a/hcatalog/core/src/test/java/org/apache/hive/hcatalog/mapreduce/TestHCatMultiOutputFormat.java b/hcatalog/core/src/test/java/org/apache/hive/hcatalog/mapreduce/TestHCatMultiOutputFormat.java index 9fa263d..6ff48ee 100644 --- a/hcatalog/core/src/test/java/org/apache/hive/hcatalog/mapreduce/TestHCatMultiOutputFormat.java +++ b/hcatalog/core/src/test/java/org/apache/hive/hcatalog/mapreduce/TestHCatMultiOutputFormat.java @@ -33,8 +33,8 @@ import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.HiveMetaStore; import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; +import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; import org.apache.hadoop.hive.metastore.api.SerDeInfo; @@ -89,7 +89,7 @@ public class TestHCatMultiOutputFormat { private static HiveConf hiveConf; private static File workDir; - private static final String msPort = "20199"; + private static int msPort; private static Thread t; static { @@ -98,22 +98,6 @@ public class TestHCatMultiOutputFormat { schemaMap.put(tableNames[2], new HCatSchema(ColumnHolder.hCattest3Cols)); } - private static class RunMS implements Runnable { - -@Override -public void run() { - try { -String warehouseConf = HiveConf.ConfVars.METASTOREWAREHOUSE.varname + "=" - + warehousedir.toString(); -HiveMetaStore.main(new String[]{"-v", "-p", msPort, "--hiveconf", warehouseConf}); - } catch (Throwable t) { -System.err.println("Exiting. Got exception from metastore: " + t.getMessage()); -t.printStackTrace(); - } -} - - } - /** * Private class which holds all the data for the test cases */ @@ -173,10 +157,11 @@ public class TestHCatMultiOutputFormat { warehousedir = new Path(System.getProperty("test.warehouse.dir")); -// Run hive metastore server -t = new Thread(new RunMS()); -t.start(); +HiveConf metastoreConf = new HiveConf(); +metastoreConf.setVar(HiveConf.ConfVars.METASTOREWAREHOUSE, warehousedir.toString()); +// Run hive metastore server +msPort = MetaStoreUtils.startMetaStore(metastoreConf); // LocalJobRunner does not work with mapreduce OutputCommitter. So need // to use MiniMRCluster. MAPREDUCE-2350 Configuration conf = new Configuration(true); http://git-wip-us.apache.org/repos/asf/hive/blob/0ea9d35d/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/TestHCatClient.java -- diff --git a/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/TestHCatClient.java b/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/TestHCatClient.java index aa9c7d3..48ee7cf 100644 --- a/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/TestHCatClient.java +++ b/hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/TestHCatClient.java @@ -34,8 +34,8 @@ import com.google.common.collect.Iterables; import
[1/2] hive git commit: HIVE-13598: Describe extended table should show the primary keys/foreign keys associated with the table (Hari Subramaniyan, reviewed by Ashutosh Chauhan)
Repository: hive Updated Branches: refs/heads/master adca6875c -> 882a7f000 http://git-wip-us.apache.org/repos/asf/hive/blob/882a7f00/ql/src/test/results/clientpositive/create_with_constraints.q.out -- diff --git a/ql/src/test/results/clientpositive/create_with_constraints.q.out b/ql/src/test/results/clientpositive/create_with_constraints.q.out index 7a7a50a..34dac30 100644 --- a/ql/src/test/results/clientpositive/create_with_constraints.q.out +++ b/ql/src/test/results/clientpositive/create_with_constraints.q.out @@ -92,6 +92,620 @@ foreign key (c) references table4(x) disable novalidate) POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@table11 +PREHOOK: query: DESCRIBE EXTENDED table1 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table1 +POSTHOOK: query: DESCRIBE EXTENDED table1 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table1 +a string +b string + + A masked pattern was here +ConstraintsPrimary Key for default.table1:[a], Constraint Name: A masked pattern was here +PREHOOK: query: DESCRIBE EXTENDED table2 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table2 +POSTHOOK: query: DESCRIBE EXTENDED table2 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table2 +a string +b string + + A masked pattern was here +ConstraintsPrimary Key for default.table2:[a], Constraint Name: pk1 +PREHOOK: query: DESCRIBE EXTENDED table3 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table3 +POSTHOOK: query: DESCRIBE EXTENDED table3 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table3 +x string + + A masked pattern was here +ConstraintsPrimary Key for default.table3:[x], Constraint Name: A masked pattern was here +PREHOOK: query: DESCRIBE EXTENDED table4 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table4 +POSTHOOK: query: DESCRIBE EXTENDED table4 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table4 +x string +y string + + A masked pattern was here +ConstraintsPrimary Key for default.table4:[x], Constraint Name: A masked pattern was here +Foreign Keys for default.table4:[ {Constraint Name: fk3, (Parent Column Name: default.table2.a, Column Name: y, Key Sequence: 1)}] +PREHOOK: query: DESCRIBE EXTENDED table5 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table5 +POSTHOOK: query: DESCRIBE EXTENDED table5 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table5 +x string + + A masked pattern was here +ConstraintsPrimary Key for default.table5:[x], Constraint Name: A masked pattern was here +PREHOOK: query: DESCRIBE EXTENDED table6 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table6 +POSTHOOK: query: DESCRIBE EXTENDED table6 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table6 +x string +y string + + A masked pattern was here +ConstraintsPrimary Key for default.table6:[x], Constraint Name: A masked pattern was here +Foreign Keys for default.table6:[ {Constraint Name: fk4, (Parent Column Name: default.table1.a, Column Name: y, Key Sequence: 1)}] +PREHOOK: query: DESCRIBE EXTENDED table7 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table7 +POSTHOOK: query: DESCRIBE EXTENDED table7 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table7 +a string +b string + + A masked pattern was here +ConstraintsPrimary Key for default.table7:[a], Constraint Name: A masked pattern was here +PREHOOK: query: DESCRIBE EXTENDED table8 +PREHOOK: type: DESCTABLE +PREHOOK: Input: default@table8 +POSTHOOK: query: DESCRIBE EXTENDED table8 +POSTHOOK: type: DESCTABLE +POSTHOOK: Input: default@table8 +a string +b string + + A masked pattern was here +ConstraintsPrimary Key for default.table8:[a], Constraint Name: pk8 +PREHOOK: query: DESCRIBE EXTENDED table9
[2/2] hive git commit: HIVE-13598: Describe extended table should show the primary keys/foreign keys associated with the table (Hari Subramaniyan, reviewed by Ashutosh Chauhan)
HIVE-13598: Describe extended table should show the primary keys/foreign keys associated with the table (Hari Subramaniyan, reviewed by Ashutosh Chauhan) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/882a7f00 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/882a7f00 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/882a7f00 Branch: refs/heads/master Commit: 882a7f0005d95800ed5657f8a7606301d22cb228 Parents: adca687 Author: Hari SubramaniyanAuthored: Tue May 10 02:31:40 2016 -0700 Committer: Hari Subramaniyan Committed: Tue May 10 02:31:40 2016 -0700 -- .../org/apache/hadoop/hive/ql/QTestUtil.java| 4 +- metastore/if/hive_metastore.thrift | 8 +- .../upgrade/derby/034-HIVE-13076.derby.sql | 2 +- .../upgrade/derby/hive-schema-2.1.0.derby.sql | 2 +- .../upgrade/mssql/019-HIVE-13076.mssql.sql | 2 + .../upgrade/mssql/hive-schema-2.1.0.mssql.sql | 2 + .../upgrade/mysql/034-HIVE-13076.mysql.sql | 2 + .../upgrade/mysql/hive-schema-2.1.0.mysql.sql | 2 + .../upgrade/oracle/034-HIVE-13076.oracle.sql| 2 + .../upgrade/oracle/hive-schema-2.1.0.oracle.sql | 2 + .../postgres/033-HIVE-13076.postgres.sql| 2 + .../postgres/hive-schema-2.1.0.postgres.sql | 2 + .../gen/thrift/gen-cpp/hive_metastore_types.cpp | 23 +- .../gen/thrift/gen-cpp/hive_metastore_types.h | 9 + .../hive/metastore/api/ForeignKeysRequest.java | 79 +- .../gen/thrift/gen-py/hive_metastore/ttypes.py | 8 - .../gen/thrift/gen-rb/hive_metastore_types.rb | 4 - .../hive/metastore/MetaStoreDirectSql.java | 24 +- .../hadoop/hive/metastore/ObjectStore.java | 79 +- .../hive/metastore/model/MConstraint.java | 43 +- metastore/src/model/package.jdo | 6 + .../org/apache/hadoop/hive/ql/exec/DDLTask.java | 11 +- .../hadoop/hive/ql/metadata/ForeignKeyInfo.java | 136 +++ .../apache/hadoop/hive/ql/metadata/Hive.java| 36 + .../hadoop/hive/ql/metadata/PrimaryKeyInfo.java | 107 +++ .../formatting/JsonMetaDataFormatter.java | 10 +- .../formatting/MetaDataFormatUtils.java | 67 ++ .../metadata/formatting/MetaDataFormatter.java | 6 +- .../formatting/TextMetaDataFormatter.java | 23 +- .../clientpositive/create_with_constraints.q| 40 + .../create_with_constraints.q.out | 861 +++ 31 files changed, 1476 insertions(+), 128 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/882a7f00/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 9863d6c..9e3aefb 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 @@ -1468,7 +1468,9 @@ public class QTestUtil { ".*Input:.*/data/files/.*", ".*Output:.*/data/files/.*", ".*total number of created files now is.*", - ".*.hive-staging.*" + ".*.hive-staging.*", + "pk_-?[0-9]*_[0-9]*_[0-9]*", + "fk_-?[0-9]*_[0-9]*_[0-9]*" }); private final Pattern[] partialReservedPlanMask = toPattern(new String[] { http://git-wip-us.apache.org/repos/asf/hive/blob/882a7f00/metastore/if/hive_metastore.thrift -- diff --git a/metastore/if/hive_metastore.thrift b/metastore/if/hive_metastore.thrift index 44dc824..2eac836 100755 --- a/metastore/if/hive_metastore.thrift +++ b/metastore/if/hive_metastore.thrift @@ -477,10 +477,10 @@ struct PrimaryKeysResponse { } struct ForeignKeysRequest { - 1: required string parent_db_name, - 2: required string parent_tbl_name, - 3: required string foreign_db_name, - 4: required string foreign_tbl_name + 1: string parent_db_name, + 2: string parent_tbl_name, + 3: string foreign_db_name, + 4: string foreign_tbl_name } struct ForeignKeysResponse { http://git-wip-us.apache.org/repos/asf/hive/blob/882a7f00/metastore/scripts/upgrade/derby/034-HIVE-13076.derby.sql -- diff --git a/metastore/scripts/upgrade/derby/034-HIVE-13076.derby.sql b/metastore/scripts/upgrade/derby/034-HIVE-13076.derby.sql index b062c56..acf93ef 100644 --- a/metastore/scripts/upgrade/derby/034-HIVE-13076.derby.sql +++ b/metastore/scripts/upgrade/derby/034-HIVE-13076.derby.sql @@ -1,3 +1,3 @@ -CREATE TABLE "APP"."KEY_CONSTRAINTS" ("CHILD_CD_ID" BIGINT, "CHILD_TBL_ID" BIGINT, "PARENT_CD_ID" BIGINT NOT NULL, "PARENT_TBL_ID" BIGINT NOT NULL,