hive git commit: Remove unintended import that caused build failure for JDK 8 in commit 4533d21b0be487e1f11fcc95578a2ba103e72a64 HIVE-13682: EOFException with fast hashtable (Matt McCline, reviewed by
Repository: hive Updated Branches: refs/heads/master bb1ee8167 -> e73891415 Remove unintended import that caused build failure for JDK 8 in commit 4533d21b0be487e1f11fcc95578a2ba103e72a64 HIVE-13682: EOFException with fast hashtable (Matt McCline, 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/e7389141 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/e7389141 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/e7389141 Branch: refs/heads/master Commit: e738914157ca311dd880ca9607aa27c0e78e1caf Parents: bb1ee81 Author: Matt McClineAuthored: Mon May 16 13:41:38 2016 -0700 Committer: Matt McCline Committed: Mon May 16 13:41:38 2016 -0700 -- .../org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/e7389141/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java -- diff --git a/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java b/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java index 1349f74..df5e8db 100644 --- a/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java +++ b/serde/src/test/org/apache/hadoop/hive/serde2/binarysortable/MyTestClass.java @@ -53,8 +53,6 @@ import org.apache.hadoop.hive.serde2.typeinfo.CharTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.VarcharTypeInfo; -import com.sun.jdi.PrimitiveType; - public class MyTestClass { public Boolean myBool;
hive git commit: HIVE-13753 : Make metastore client thread safe in DbTxnManager (Wei Zheng, reviewed by Vaibhav Gumashta)
Repository: hive Updated Branches: refs/heads/branch-1 14ac6de6c -> d273fba8f HIVE-13753 : Make metastore client thread safe in DbTxnManager (Wei Zheng, reviewed by Vaibhav Gumashta) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/d273fba8 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d273fba8 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d273fba8 Branch: refs/heads/branch-1 Commit: d273fba8f54fcea887c2873ecf84c6cafe6d6aa6 Parents: 14ac6de Author: Wei ZhengAuthored: Mon May 16 10:24:39 2016 -0700 Committer: Wei Zheng Committed: Mon May 16 10:26:19 2016 -0700 -- .../hadoop/hive/ql/lockmgr/DbLockManager.java | 4 +- .../hadoop/hive/ql/lockmgr/DbTxnManager.java| 50 +++- 2 files changed, 50 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/d273fba8/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java index ad4bd4c..089a48a 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java @@ -50,11 +50,11 @@ public class DbLockManager implements HiveLockManager{ private long MAX_SLEEP; //longer term we should always have a txn id and then we won't need to track locks here at all private Set locks; - private IMetaStoreClient client; + private DbTxnManager.SynchronizedMetaStoreClient client; private long nextSleep = 50; private final HiveConf conf; - DbLockManager(IMetaStoreClient client, HiveConf conf) { + DbLockManager(DbTxnManager.SynchronizedMetaStoreClient client, HiveConf conf) { locks = new HashSet<>(); this.client = client; this.conf = conf; http://git-wip-us.apache.org/repos/asf/hive/blob/d273fba8/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java index b0f1362..21b0cb2 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java @@ -61,7 +61,7 @@ public class DbTxnManager extends HiveTxnManagerImpl { static final private Log LOG = LogFactory.getLog(CLASS_NAME); private DbLockManager lockMgr = null; - private IMetaStoreClient client = null; + private SynchronizedMetaStoreClient client = null; /** * The Metastore NEXT_TXN_ID.NTXN_NEXT is initialized to 1; it contains the next available * transaction id. Thus is 1 is first transaction id. @@ -518,7 +518,7 @@ public class DbTxnManager extends HiveTxnManagerImpl { } try { Hive db = Hive.get(conf); -client = db.getMSC(); +client = new SynchronizedMetaStoreClient(db.getMSC()); initHeartbeatExecutorService(); } catch (MetaException e) { throw new LockException(ErrorMsg.METASTORE_COULD_NOT_INITIATE.getMsg(), e); @@ -613,4 +613,50 @@ public class DbTxnManager extends HiveTxnManagerImpl { } } } + + /** + * Synchronized MetaStoreClient wrapper + */ + final class SynchronizedMetaStoreClient { +private final IMetaStoreClient client; +SynchronizedMetaStoreClient(IMetaStoreClient client) { + this.client = client; +} + +synchronized long openTxn(String user) throws TException { + return client.openTxn(user); +} + +synchronized void commitTxn(long txnid) throws TException { + client.commitTxn(txnid); +} + +synchronized void rollbackTxn(long txnid) throws TException { + client.rollbackTxn(txnid); +} + +synchronized void heartbeat(long txnid, long lockid) throws TException { + client.heartbeat(txnid, lockid); +} + +synchronized ValidTxnList getValidTxns(long currentTxn) throws TException { + return client.getValidTxns(currentTxn); +} + +synchronized LockResponse lock(LockRequest request) throws TException { + return client.lock(request); +} + +synchronized LockResponse checkLock(long lockid) throws TException { + return client.checkLock(lockid); +} + +synchronized void unlock(long lockid) throws TException { + client.unlock(lockid); +} + +synchronized ShowLocksResponse showLocks(ShowLocksRequest showLocksRequest) throws TException { + return client.showLocks(showLocksRequest); +} + } }
hive git commit: HIVE-13753 : Make metastore client thread safe in DbTxnManager (Wei Zheng, reviewed by Vaibhav Gumashta)
Repository: hive Updated Branches: refs/heads/master 6cb5dbe64 -> bb1ee8167 HIVE-13753 : Make metastore client thread safe in DbTxnManager (Wei Zheng, reviewed by Vaibhav Gumashta) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/bb1ee816 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/bb1ee816 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/bb1ee816 Branch: refs/heads/master Commit: bb1ee8167006fb8ae7868502d95ebc31f6ea3dd5 Parents: 6cb5dbe Author: Wei ZhengAuthored: Mon May 16 10:24:39 2016 -0700 Committer: Wei Zheng Committed: Mon May 16 10:24:39 2016 -0700 -- .../hadoop/hive/ql/lockmgr/DbLockManager.java | 4 +- .../hadoop/hive/ql/lockmgr/DbTxnManager.java| 50 +++- 2 files changed, 50 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/bb1ee816/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java index 2804514..b4ae1d1 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbLockManager.java @@ -54,11 +54,11 @@ public class DbLockManager implements HiveLockManager{ private long MAX_SLEEP; //longer term we should always have a txn id and then we won't need to track locks here at all private Set locks; - private IMetaStoreClient client; + private DbTxnManager.SynchronizedMetaStoreClient client; private long nextSleep = 50; private final HiveConf conf; - DbLockManager(IMetaStoreClient client, HiveConf conf) { + DbLockManager(DbTxnManager.SynchronizedMetaStoreClient client, HiveConf conf) { locks = new HashSet<>(); this.client = client; this.conf = conf; http://git-wip-us.apache.org/repos/asf/hive/blob/bb1ee816/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java index 4539e71..9ab6169 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java @@ -62,7 +62,7 @@ public class DbTxnManager extends HiveTxnManagerImpl { static final private Logger LOG = LoggerFactory.getLogger(CLASS_NAME); private DbLockManager lockMgr = null; - private IMetaStoreClient client = null; + private SynchronizedMetaStoreClient client = null; /** * The Metastore NEXT_TXN_ID.NTXN_NEXT is initialized to 1; it contains the next available * transaction id. Thus is 1 is first transaction id. @@ -520,7 +520,7 @@ public class DbTxnManager extends HiveTxnManagerImpl { } try { Hive db = Hive.get(conf); -client = db.getMSC(); +client = new SynchronizedMetaStoreClient(db.getMSC()); initHeartbeatExecutorService(); } catch (MetaException e) { throw new LockException(ErrorMsg.METASTORE_COULD_NOT_INITIATE.getMsg(), e); @@ -615,4 +615,50 @@ public class DbTxnManager extends HiveTxnManagerImpl { } } } + + /** + * Synchronized MetaStoreClient wrapper + */ + final class SynchronizedMetaStoreClient { +private final IMetaStoreClient client; +SynchronizedMetaStoreClient(IMetaStoreClient client) { + this.client = client; +} + +synchronized long openTxn(String user) throws TException { + return client.openTxn(user); +} + +synchronized void commitTxn(long txnid) throws TException { + client.commitTxn(txnid); +} + +synchronized void rollbackTxn(long txnid) throws TException { + client.rollbackTxn(txnid); +} + +synchronized void heartbeat(long txnid, long lockid) throws TException { + client.heartbeat(txnid, lockid); +} + +synchronized ValidTxnList getValidTxns(long currentTxn) throws TException { + return client.getValidTxns(currentTxn); +} + +synchronized LockResponse lock(LockRequest request) throws TException { + return client.lock(request); +} + +synchronized LockResponse checkLock(long lockid) throws TException { + return client.checkLock(lockid); +} + +synchronized void unlock(long lockid) throws TException { + client.unlock(lockid); +} + +synchronized ShowLocksResponse showLocks(ShowLocksRequest showLocksRequest) throws TException { + return client.showLocks(showLocksRequest); +} + } }
hive git commit: HIVE-13758: "Create table like" command should initialize the basic stats for the table (Pengcheng Xiong, reviewed by Ashutosh Chauhan)
Repository: hive Updated Branches: refs/heads/master 4533d21b0 -> 6cb5dbe64 HIVE-13758: "Create table like" command should initialize the basic stats for the table (Pengcheng Xiong, 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/6cb5dbe6 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/6cb5dbe6 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/6cb5dbe6 Branch: refs/heads/master Commit: 6cb5dbe64968f052266f491492225e925e437dac Parents: 4533d21 Author: Pengcheng XiongAuthored: Mon May 16 10:10:16 2016 -0700 Committer: Pengcheng Xiong Committed: Mon May 16 10:10:28 2016 -0700 -- .../org/apache/hadoop/hive/ql/exec/DDLTask.java | 6 + .../clientpositive/create_table_like_stats.q| 30 +++ .../create_alter_list_bucketing_table1.q.out| 5 + .../results/clientpositive/create_like.q.out| 30 +++ .../results/clientpositive/create_like2.q.out | 5 + .../clientpositive/create_like_tbl_props.q.out | 25 +++ .../clientpositive/create_like_view.q.out | 10 + .../create_table_like_stats.q.out | 205 +++ .../insert_values_orig_table_use_metadata.q.out | 5 + .../clientpositive/mapjoin_memcheck.q.out | 16 +- .../clientpositive/spark/mapjoin_memcheck.q.out | 16 +- 11 files changed, 337 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hive/blob/6cb5dbe6/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java -- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java index 707de1f..1ebe963 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java @@ -4121,6 +4121,12 @@ public class DDLTask extends Task implements Serializable { makeLocationQualified(tbl.getDbName(), tbl.getTTable().getSd(), tbl.getTableName(), conf); } +if (crtTbl.getLocation() == null && !tbl.isPartitioned() +&& conf.getBoolVar(HiveConf.ConfVars.HIVESTATSAUTOGATHER)) { + StatsSetupConst.setBasicStatsStateForCreateTable(tbl.getTTable().getParameters(), + StatsSetupConst.TRUE); +} + // create the table db.createTable(tbl, crtTbl.getIfNotExists()); work.getOutputs().add(new WriteEntity(tbl, WriteEntity.WriteType.DDL_NO_LOCK)); http://git-wip-us.apache.org/repos/asf/hive/blob/6cb5dbe6/ql/src/test/queries/clientpositive/create_table_like_stats.q -- diff --git a/ql/src/test/queries/clientpositive/create_table_like_stats.q b/ql/src/test/queries/clientpositive/create_table_like_stats.q new file mode 100644 index 000..1fc --- /dev/null +++ b/ql/src/test/queries/clientpositive/create_table_like_stats.q @@ -0,0 +1,30 @@ +set hive.mapred.mode=nonstrict; + +dfs ${system:test.dfs.mkdir} ${system:test.tmp.dir}/t; + +drop table a; + +create table a like src; + +desc formatted a; + +drop table a; + +create table a like src location '${system:test.tmp.dir}/t'; + +desc formatted a; + +drop table a; + +create table a (key STRING COMMENT 'default', value STRING COMMENT 'default') +PARTITIONED BY (ds STRING, hr STRING) +STORED AS TEXTFILE; + +desc formatted a; + +drop table a; + +create table a like srcpart; + +desc formatted a; + http://git-wip-us.apache.org/repos/asf/hive/blob/6cb5dbe6/ql/src/test/results/clientpositive/create_alter_list_bucketing_table1.q.out -- diff --git a/ql/src/test/results/clientpositive/create_alter_list_bucketing_table1.q.out b/ql/src/test/results/clientpositive/create_alter_list_bucketing_table1.q.out index f68bcb1..df4a75b 100644 --- a/ql/src/test/results/clientpositive/create_alter_list_bucketing_table1.q.out +++ b/ql/src/test/results/clientpositive/create_alter_list_bucketing_table1.q.out @@ -330,6 +330,11 @@ Retention: 0 A masked pattern was here Table Type:MANAGED_TABLE Table Parameters: + COLUMN_STATS_ACCURATE {\"BASIC_STATS\":\"true\"} + numFiles0 + numRows 0 + rawDataSize 0 + totalSize 0 A masked pattern was here # Storage Information http://git-wip-us.apache.org/repos/asf/hive/blob/6cb5dbe6/ql/src/test/results/clientpositive/create_like.q.out -- diff --git