diff --git beeline/pom.xml beeline/pom.xml index bb627f2f63..b19afd171f 100644 --- beeline/pom.xml +++ beeline/pom.xml @@ -118,7 +118,7 @@ org.apache.hive hive-service ${project.version} - test + diff --git conf/hive-site.xml conf/hive-site.xml index dab494e4bd..8f638209eb 100644 --- conf/hive-site.xml +++ conf/hive-site.xml @@ -18,5 +18,210 @@ --> + + hive.metastore.try.direct.sql + true + + + + hive.metastore.try.direct.sql.ddl + true + + + + + + hive.jar.path + /Users/zchovan/dev/hive/ql/target/hive-exec-2.1.1-cdh6.3.x-SNAPSHOT.jar + The location of hive_cli.jar that is used when submitting jobs in a separate jvm. + + + + hive.hadoop.classpath + /Users/zchovan/dev/hive/ql/target/hive-exec-2.1.1-cdh6.3.x-SNAPSHOT.jar + + + + hive.metastore.local + false + + + + hive.metastore.uris + thrift://localhost:9083 + + + + hive.metastore.warehouse.dir + pfile:///Users/zchovan/data/cdh/hive/warehouse + + + + fs.pfile.impl + org.apache.hadoop.fs.ProxyLocalFileSystem + A proxy for local file system used for cross file system testing + + + + hive.metastore.schema.verification + false + + + + datanucleus.autoCreateTables + true + + + + datanucleus.schema.autoCreateAll + true + + + + hive.exec.scratchdir + /tmp/hive-${user.name} + + + + metastore.storage.schema.reader.impl + org.apache.hadoop.hive.metastore.SerDeStorageSchemaReader + + + + + + + + + + + + + + + + + + + javax.jdo.option.ConnectionURL + jdbc:postgresql://localhost:32779/hive + PostgreSQL JDBC driver connection URL + + + + javax.jdo.option.ConnectionDriverName + org.postgresql.Driver + PostgreSQL metastore driver class name + + + + javax.jdo.option.ConnectionUserName + postgres + + + + javax.jdo.option.ConnectionPassword + postgres + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dfs.namenode.acls.enabled + false + + + + hive.metastore.event.db.notification.api.auth + false + + + + + + + + + hive.metastore.try.direct.sql + true + + + + + + + + + hive.txn.manager + org.apache.hadoop.hive.ql.lockmgr.DbTxnManager + + + + hive.support.concurrency + true + + + + hive.scheduled.queries.executor.enabled + false + + + + hive.scheduled.queries.max.executors + 0 + diff --git ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java index f75eb85d2f..470fd0b8d2 100644 --- ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java +++ ql/src/java/org/apache/hadoop/hive/ql/hooks/WriteEntity.java @@ -214,13 +214,13 @@ public static WriteType determineAlterTableWriteType(AlterTableType op) { case SET_SKEWED_LOCATION: case INTO_BUCKETS: case ALTERPARTITION: - case ADDCOLS: case RENAME: case TRUNCATE: case MERGEFILES: case DROP_CONSTRAINT: return WriteType.DDL_EXCLUSIVE; + case ADDCOLS: case ADDPARTITION: case SET_SERDE_PROPS: case ADDPROPS: diff --git ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java index 1687425bcb..f538589f71 100644 --- ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java +++ ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager2.java @@ -2739,6 +2739,20 @@ public void testAddPartitionLocks() throws Exception { checkLock(LockType.EXCLUSIVE, LockState.ACQUIRED, "default", "T", null, locks); } + @Test + public void testAddColumnLocks() throws Exception { + dropTable(new String[] {"T"}); + driver.run("create table T (a int, b int) " + + "stored as orc " + + "tblproperties('transactional'='true')"); + driver.run("insert into T values(0,0),(0,1)"); + driver.compileAndRespond("alter table t add columns(c int)"); + txnMgr.acquireLocks(driver.getPlan(), ctx, "username"); + List locks = getLocks(); + Assert.assertEquals("Unexpected lock count", 1, locks.size()); + checkLock(LockType.SHARED_READ, LockState.ACQUIRED, "default", "T", null, locks); + } + @Test public void testLoadData() throws Exception { testLoadData(false);