hive git commit: Revert "HIVE-17020: Aggressive RS dedup can incorrectly remove OP tree branch (Vineet Garg, reviewed by Rui Li)"

2018-12-12 Thread vgarg
Repository: hive
Updated Branches:
  refs/heads/master 881e29124 -> a43581b6d


Revert "HIVE-17020: Aggressive RS dedup can incorrectly remove OP tree branch 
(Vineet Garg, reviewed by Rui Li)"

This reverts commit 8d084d676539b6ba3b9fd46e86505cca4be95b43.


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a43581b6
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a43581b6
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a43581b6

Branch: refs/heads/master
Commit: a43581b6d884a7041930644fb3a580e398bc6951
Parents: 881e291
Author: Vineet Garg 
Authored: Wed Dec 12 16:37:37 2018 -0800
Committer: Vineet Garg 
Committed: Wed Dec 12 16:37:37 2018 -0800

--
 .../test/resources/testconfiguration.properties |   1 -
 .../ReduceSinkDeDuplicationUtils.java   |  32 +--
 .../queries/clientpositive/reducesink_dedup.q   |  12 +-
 .../clientpositive/llap/reducesink_dedup.q.out  | 229 ---
 .../clientpositive/reducesink_dedup.q.out   | 202 +---
 5 files changed, 14 insertions(+), 462 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/a43581b6/itests/src/test/resources/testconfiguration.properties
--
diff --git a/itests/src/test/resources/testconfiguration.properties 
b/itests/src/test/resources/testconfiguration.properties
index e32fc60..01cad2a 100644
--- a/itests/src/test/resources/testconfiguration.properties
+++ b/itests/src/test/resources/testconfiguration.properties
@@ -634,7 +634,6 @@ minillaplocal.query.files=\
   ptf_streaming.q,\
   runtime_stats_merge.q,\
   quotedid_smb.q,\
-  reducesink_dedup.q,\
   resourceplan.q,\
   results_cache_1.q,\
   results_cache_2.q,\

http://git-wip-us.apache.org/repos/asf/hive/blob/a43581b6/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
--
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
index 23ec1eb..7ccd4a3 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
@@ -475,25 +475,6 @@ public class ReduceSinkDeDuplicationUtils {
 return 0;
   }
 
-  // Check that in the path between cRS and pRS, there are only Select 
operators
-  // i.e. the sequence must be pRS-SEL*-cRS
-  // ensure SEL does not branch
-  protected static boolean checkSelectSingleBranchOnly(ReduceSinkOperator cRS, 
ReduceSinkOperator pRS) {
-Operator parent = cRS.getParentOperators().get(0);
-while (parent != pRS) {
-  assert parent.getNumParent() == 1;
-  if (!(parent instanceof SelectOperator)) {
-return false;
-  }
-  if (parent.getChildOperators().size() > 1) {
-return false;
-  }
-
-  parent = parent.getParentOperators().get(0);
-}
-return true;
-  }
-
   protected static boolean aggressiveDedup(ReduceSinkOperator cRS, 
ReduceSinkOperator pRS,
   ReduceSinkDeduplicateProcCtx dedupCtx) throws SemanticException {
 assert cRS.getNumParent() == 1;
@@ -503,8 +484,15 @@ public class ReduceSinkDeDuplicationUtils {
 List cKeys = cConf.getKeyCols();
 List pKeys = pConf.getKeyCols();
 
-if (!checkSelectSingleBranchOnly(cRS, pRS)) {
-  return false;
+// Check that in the path between cRS and pRS, there are only Select 
operators
+// i.e. the sequence must be pRS-SEL*-cRS
+Operator parent = cRS.getParentOperators().get(0);
+while (parent != pRS) {
+  assert parent.getNumParent() == 1;
+  if (!(parent instanceof SelectOperator)) {
+return false;
+  }
+  parent = parent.getParentOperators().get(0);
 }
 
 // If child keys are null or empty, we bail out
@@ -576,7 +564,7 @@ public class ReduceSinkDeDuplicationUtils {
 
 // Replace pRS with cRS and remove operator sequence from pRS to cRS
 // Recall that the sequence must be pRS-SEL*-cRS
-Operator parent = cRS.getParentOperators().get(0);
+parent = cRS.getParentOperators().get(0);
 while (parent != pRS) {
   dedupCtx.addRemovedOperator(parent);
   parent = parent.getParentOperators().get(0);

http://git-wip-us.apache.org/repos/asf/hive/blob/a43581b6/ql/src/test/queries/clientpositive/reducesink_dedup.q
--
diff --git a/ql/src/test/queries/clientpositive/reducesink_dedup.q 
b/ql/src/test/queries/clientpositive/reducesink_dedup.q
index b7f9a01..352a558 100644
--- 

hive git commit: HIVE-20998: HiveStrictManagedMigration utility should update DB/Table location as last migration steps (Jason Dere, reviewed by Ashutosh Chauhan)

2018-12-12 Thread jdere
Repository: hive
Updated Branches:
  refs/heads/master 8d084d676 -> 881e29124


HIVE-20998: HiveStrictManagedMigration utility should update DB/Table location 
as last migration steps (Jason Dere, 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/881e2912
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/881e2912
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/881e2912

Branch: refs/heads/master
Commit: 881e291246a367f0a413da3bb13be410923a37cf
Parents: 8d084d6
Author: Jason Dere 
Authored: Wed Dec 12 14:33:27 2018 -0800
Committer: Jason Dere 
Committed: Wed Dec 12 14:33:27 2018 -0800

--
 .../ql/util/HiveStrictManagedMigration.java | 38 +++-
 1 file changed, 30 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/881e2912/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java
--
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java 
b/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java
index 9535bed..80025b7 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/util/HiveStrictManagedMigration.java
@@ -404,11 +404,6 @@ public class HiveStrictManagedMigration {
 // Set appropriate owner/perms of the DB dir only, no need to recurse
 checkAndSetFileOwnerPermissions(fs, newDefaultDbLocation,
 ownerName, groupName, dirPerms, null, runOptions.dryRun, false);
-
-// The table processing needs the db location at the old location, so 
clone the DB object
-// when updating the location.
-Database modifiedDb = dbObj.deepCopy();
-getHiveUpdater().updateDbLocation(modifiedDb, newDefaultDbLocation);
   }
 }
 
@@ -416,6 +411,7 @@ public class HiveStrictManagedMigration {
   createExternalDbDir(dbObj);
 }
 
+boolean errorsInThisDb = false;
 List tableNames = hms.getTables(dbName, runOptions.tableRegex);
 for (String tableName : tableNames) {
   // If we did not change the DB location, there is no need to move the 
table directories.
@@ -424,6 +420,20 @@ public class HiveStrictManagedMigration {
   } catch (Exception err) {
 LOG.error("Error processing table " + 
getQualifiedName(dbObj.getName(), tableName), err);
 failuresEncountered = true;
+errorsInThisDb = true;
+  }
+}
+
+// Finally update the DB location. This would prevent subsequent runs of 
the migration from processing this DB.
+if (modifyDefaultManagedLocation) {
+  if (errorsInThisDb) {
+LOG.error("Not updating database location for {} since an error was 
encountered. The migration must be run again for this database.",
+dbObj.getName());
+  } else {
+Path newDefaultDbLocation = wh.getDefaultDatabasePath(dbName);
+// dbObj after this call would have the new DB location.
+// Keep that in mind if anything below this requires the old DB path.
+getHiveUpdater().updateDbLocation(dbObj, newDefaultDbLocation);
   }
 }
   }
@@ -590,6 +600,8 @@ public class HiveStrictManagedMigration {
 Path oldTablePath = new Path(tableObj.getSd().getLocation());
 
 LOG.info("Moving location of {} from {} to {}", 
getQualifiedName(tableObj), oldTablePath, newTablePath);
+
+// Move table directory.
 if (!runOptions.dryRun) {
   FileSystem fs = newTablePath.getFileSystem(conf);
   if (fs.exists(oldTablePath)) {
@@ -601,9 +613,13 @@ public class HiveStrictManagedMigration {
 }
   }
 }
-if (!runOptions.dryRun) {
-  getHiveUpdater().updateTableLocation(tableObj, newTablePath);
-}
+
+// An error occurring between here and before updating the table's 
location in the metastore
+// may potentially cause the data to reside in the new location, while the
+// table/partitions point to the old paths.
+// The migration would be _REQUIRED_ to run again (and pass) for the data 
and table/partition
+// locations to be in sync.
+
 if (isPartitionedTable(tableObj)) {
   List partNames = hms.listPartitionNames(dbName, tableName, 
Short.MAX_VALUE);
   // TODO: Fetch partitions in batches?
@@ -622,6 +638,12 @@ public class HiveStrictManagedMigration {
 }
   }
 }
+
+// Finally update the table location. This would prevent this tool from 
processing this table again
+// on subsequent runs of the migration.
+if (!runOptions.dryRun) {
+  getHiveUpdater().updateTableLocation(tableObj, newTablePath);
+}
   }
 
   static void renameFilesToConformToAcid(Table tableObj, 

hive git commit: HIVE-17020: Aggressive RS dedup can incorrectly remove OP tree branch (Vineet Garg, reviewed by Rui Li)

2018-12-12 Thread vgarg
Repository: hive
Updated Branches:
  refs/heads/master d1e219ddd -> 8d084d676


HIVE-17020: Aggressive RS dedup can incorrectly remove OP tree branch (Vineet 
Garg, reviewed by Rui Li)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/8d084d67
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/8d084d67
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/8d084d67

Branch: refs/heads/master
Commit: 8d084d676539b6ba3b9fd46e86505cca4be95b43
Parents: d1e219d
Author: Vineet Garg 
Authored: Wed Dec 12 10:22:50 2018 -0800
Committer: Vineet Garg 
Committed: Wed Dec 12 10:23:17 2018 -0800

--
 .../test/resources/testconfiguration.properties |   1 +
 .../ReduceSinkDeDuplicationUtils.java   |  32 ++-
 .../queries/clientpositive/reducesink_dedup.q   |  12 +-
 .../clientpositive/llap/reducesink_dedup.q.out  | 229 +++
 .../clientpositive/reducesink_dedup.q.out   | 202 +++-
 5 files changed, 462 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/8d084d67/itests/src/test/resources/testconfiguration.properties
--
diff --git a/itests/src/test/resources/testconfiguration.properties 
b/itests/src/test/resources/testconfiguration.properties
index 01cad2a..e32fc60 100644
--- a/itests/src/test/resources/testconfiguration.properties
+++ b/itests/src/test/resources/testconfiguration.properties
@@ -634,6 +634,7 @@ minillaplocal.query.files=\
   ptf_streaming.q,\
   runtime_stats_merge.q,\
   quotedid_smb.q,\
+  reducesink_dedup.q,\
   resourceplan.q,\
   results_cache_1.q,\
   results_cache_2.q,\

http://git-wip-us.apache.org/repos/asf/hive/blob/8d084d67/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
--
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
index 7ccd4a3..23ec1eb 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/correlation/ReduceSinkDeDuplicationUtils.java
@@ -475,6 +475,25 @@ public class ReduceSinkDeDuplicationUtils {
 return 0;
   }
 
+  // Check that in the path between cRS and pRS, there are only Select 
operators
+  // i.e. the sequence must be pRS-SEL*-cRS
+  // ensure SEL does not branch
+  protected static boolean checkSelectSingleBranchOnly(ReduceSinkOperator cRS, 
ReduceSinkOperator pRS) {
+Operator parent = cRS.getParentOperators().get(0);
+while (parent != pRS) {
+  assert parent.getNumParent() == 1;
+  if (!(parent instanceof SelectOperator)) {
+return false;
+  }
+  if (parent.getChildOperators().size() > 1) {
+return false;
+  }
+
+  parent = parent.getParentOperators().get(0);
+}
+return true;
+  }
+
   protected static boolean aggressiveDedup(ReduceSinkOperator cRS, 
ReduceSinkOperator pRS,
   ReduceSinkDeduplicateProcCtx dedupCtx) throws SemanticException {
 assert cRS.getNumParent() == 1;
@@ -484,15 +503,8 @@ public class ReduceSinkDeDuplicationUtils {
 List cKeys = cConf.getKeyCols();
 List pKeys = pConf.getKeyCols();
 
-// Check that in the path between cRS and pRS, there are only Select 
operators
-// i.e. the sequence must be pRS-SEL*-cRS
-Operator parent = cRS.getParentOperators().get(0);
-while (parent != pRS) {
-  assert parent.getNumParent() == 1;
-  if (!(parent instanceof SelectOperator)) {
-return false;
-  }
-  parent = parent.getParentOperators().get(0);
+if (!checkSelectSingleBranchOnly(cRS, pRS)) {
+  return false;
 }
 
 // If child keys are null or empty, we bail out
@@ -564,7 +576,7 @@ public class ReduceSinkDeDuplicationUtils {
 
 // Replace pRS with cRS and remove operator sequence from pRS to cRS
 // Recall that the sequence must be pRS-SEL*-cRS
-parent = cRS.getParentOperators().get(0);
+Operator parent = cRS.getParentOperators().get(0);
 while (parent != pRS) {
   dedupCtx.addRemovedOperator(parent);
   parent = parent.getParentOperators().get(0);

http://git-wip-us.apache.org/repos/asf/hive/blob/8d084d67/ql/src/test/queries/clientpositive/reducesink_dedup.q
--
diff --git a/ql/src/test/queries/clientpositive/reducesink_dedup.q 
b/ql/src/test/queries/clientpositive/reducesink_dedup.q
index 352a558..b7f9a01 100644
--- a/ql/src/test/queries/clientpositive/reducesink_dedup.q
+++ 

hive git commit: HIVE-21022: Disable test: TestRemoteHiveMetaStoreZK

2018-12-12 Thread kgyrtkirk
Repository: hive
Updated Branches:
  refs/heads/master b91b5f956 -> d1e219ddd


HIVE-21022: Disable test: TestRemoteHiveMetaStoreZK


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/d1e219dd
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d1e219dd
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d1e219dd

Branch: refs/heads/master
Commit: d1e219ddd2ffe72e670f1fd3a7ed1d96fc25f358
Parents: b91b5f9
Author: Zoltan Haindrich 
Authored: Wed Dec 12 18:00:23 2018 +0100
Committer: Zoltan Haindrich 
Committed: Wed Dec 12 18:00:34 2018 +0100

--
 .../apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZK.java| 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/d1e219dd/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZK.java
--
diff --git 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZK.java
 
b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZK.java
index f858992..0fb4e98 100644
--- 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZK.java
+++ 
b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZK.java
@@ -22,9 +22,11 @@ import org.apache.curator.test.TestingServer;
 import org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf.ConfVars;
+import org.junit.Ignore;
 import org.junit.Before;
 import org.junit.experimental.categories.Category;
 
+@Ignore("HIVE-21022: disabled until fixed")
 @Category(MetastoreCheckinTest.class)
 public class TestRemoteHiveMetaStoreZK extends TestRemoteHiveMetaStore {
   private static TestingServer zkServer = null;



hive git commit: HIVE-20961: Retire NVL implementation (Laszlo Bodor via Zoltan Haindrich)

2018-12-12 Thread kgyrtkirk
Repository: hive
Updated Branches:
  refs/heads/master 5f742cfef -> b91b5f956


HIVE-20961: Retire NVL implementation (Laszlo Bodor via Zoltan Haindrich)

Signed-off-by: Zoltan Haindrich 


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b91b5f95
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b91b5f95
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b91b5f95

Branch: refs/heads/master
Commit: b91b5f956ce68043fc516d743e0c7ee1022be332
Parents: 5f742cf
Author: Laszlo Bodor 
Authored: Wed Dec 12 13:26:34 2018 +0100
Committer: Zoltan Haindrich 
Committed: Wed Dec 12 13:26:34 2018 +0100

--
 .../positive/accumulo_predicate_pushdown.q.out  |  4 +-
 .../results/positive/hbase_ppd_key_range.q.out  |  2 +-
 .../test/results/positive/hbase_pushdown.q.out  |  2 +-
 .../hadoop/hive/ql/exec/FunctionRegistry.java   |  2 +-
 .../apache/hadoop/hive/ql/exec/Registry.java|  5 +-
 .../ql/exec/vector/VectorizationContext.java|  9 +--
 .../optimizer/ConstantPropagateProcFactory.java |  6 +-
 .../hive/ql/optimizer/physical/Vectorizer.java  |  1 -
 .../hive/ql/parse/TypeCheckProcFactory.java | 10 +--
 .../hive/ql/udf/generic/GenericUDFNvl.java  | 75 
 .../clientnegative/nvl_mismatch_type.q.out  |  2 +-
 .../clientpositive/constantPropWhen.q.out   | 16 ++---
 .../test/results/clientpositive/fold_case.q.out |  8 +--
 .../test/results/clientpositive/fold_when.q.out |  8 +--
 .../clientpositive/llap/partition_pruning.q.out | 12 ++--
 .../clientpositive/llap/udf_coalesce.q.out  |  1 +
 .../clientpositive/llap/vector_nvl.q.out|  2 +-
 .../test/results/clientpositive/udf_nvl.q.out   | 11 +--
 .../results/clientpositive/union_offcbo.q.out   | 20 +++---
 .../results/clientpositive/vector_nvl.q.out |  2 +-
 20 files changed, 61 insertions(+), 137 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/b91b5f95/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out
--
diff --git 
a/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out 
b/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out
index 8a1e060..197d3ba 100644
--- 
a/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out
+++ 
b/accumulo-handler/src/test/results/positive/accumulo_predicate_pushdown.q.out
@@ -414,10 +414,10 @@ STAGE PLANS:
   Map Operator Tree:
   TableScan
 alias: accumulo_pushdown
-filterExpr: (not NVL((key < '90'),false)) (type: boolean)
+filterExpr: (not COALESCE((key < '90'),false)) (type: boolean)
 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
 Filter Operator
-  predicate: (not NVL((key < '90'),false)) (type: boolean)
+  predicate: (not COALESCE((key < '90'),false)) (type: boolean)
   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
   Select Operator
 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/b91b5f95/hbase-handler/src/test/results/positive/hbase_ppd_key_range.q.out
--
diff --git a/hbase-handler/src/test/results/positive/hbase_ppd_key_range.q.out 
b/hbase-handler/src/test/results/positive/hbase_ppd_key_range.q.out
index 5e05154..dcfe7c7 100644
--- a/hbase-handler/src/test/results/positive/hbase_ppd_key_range.q.out
+++ b/hbase-handler/src/test/results/positive/hbase_ppd_key_range.q.out
@@ -416,7 +416,7 @@ STAGE PLANS:
 alias: hbase_pushdown
 Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
 Filter Operator
-  predicate: (not NVL((key < '90'),false)) (type: boolean)
+  predicate: (not COALESCE((key < '90'),false)) (type: boolean)
   Statistics: Num rows: 1 Data size: 0 Basic stats: PARTIAL Column 
stats: NONE
   Select Operator
 expressions: key (type: string), value (type: string)

http://git-wip-us.apache.org/repos/asf/hive/blob/b91b5f95/hbase-handler/src/test/results/positive/hbase_pushdown.q.out
--
diff --git a/hbase-handler/src/test/results/positive/hbase_pushdown.q.out 
b/hbase-handler/src/test/results/positive/hbase_pushdown.q.out
index 57613c3..e814423 100644
--- a/hbase-handler/src/test/results/positive/hbase_pushdown.q.out
+++ b/hbase-handler/src/test/results/positive/hbase_pushdown.q.out
@@ -305,7 +305,7 @@ STAGE PLANS:
 alias: hbase_pushdown
 Statistics: Num rows: 1 Data 

hive git commit: HIVE-21022: Disable test: TestRemoteHiveMetaStoreZKBindHost

2018-12-12 Thread kgyrtkirk
Repository: hive
Updated Branches:
  refs/heads/master b650083f1 -> 5f742cfef


HIVE-21022: Disable test: TestRemoteHiveMetaStoreZKBindHost


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/5f742cfe
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/5f742cfe
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/5f742cfe

Branch: refs/heads/master
Commit: 5f742cfef8a29e92f2547c5fc9f45094fbc1fa1f
Parents: b650083
Author: Zoltan Haindrich 
Authored: Wed Dec 12 13:09:28 2018 +0100
Committer: Zoltan Haindrich 
Committed: Wed Dec 12 13:09:28 2018 +0100

--
 .../hadoop/hive/metastore/TestRemoteHiveMetaStoreZKBindHost.java   | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/5f742cfe/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZKBindHost.java
--
diff --git 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZKBindHost.java
 
b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZKBindHost.java
index cd8f855..03c8e81 100644
--- 
a/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZKBindHost.java
+++ 
b/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestRemoteHiveMetaStoreZKBindHost.java
@@ -21,9 +21,11 @@ package org.apache.hadoop.hive.metastore;
 import org.apache.hadoop.hive.metastore.annotation.MetastoreCheckinTest;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf.ConfVars;
+import org.junit.Ignore;
 import org.junit.Before;
 import org.junit.experimental.categories.Category;
 
+@Ignore("HIVE-21022: disabled until fixed")
 @Category(MetastoreCheckinTest.class)
 public class TestRemoteHiveMetaStoreZKBindHost extends 
TestRemoteHiveMetaStoreZK {
 



hive git commit: HIVE-20010: Fix create view over literals (Zoltan Haindrich, reviewed by Ashutosh Chauhan, Daniel Dai)

2018-12-12 Thread kgyrtkirk
Repository: hive
Updated Branches:
  refs/heads/branch-3.1 15eca868a -> 840aa360b


HIVE-20010: Fix create view over literals (Zoltan Haindrich, reviewed by 
Ashutosh Chauhan, Daniel Dai)

(cherry picked from commit 26c5749eb73d0cc9966e78331e3c490fc2754c49)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/840aa360
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/840aa360
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/840aa360

Branch: refs/heads/branch-3.1
Commit: 840aa360bd93fee5286d0c4c39b45a0693e6199e
Parents: 15eca86
Author: Daniel Dai 
Authored: Thu Jun 28 13:02:12 2018 -0700
Committer: Zoltan Haindrich 
Committed: Wed Dec 12 11:59:53 2018 +0100

--
 .../hadoop/hive/ql/parse/SemanticAnalyzer.java  |  3 +
 .../test/queries/clientpositive/create_view.q   |  9 +++
 .../results/clientpositive/create_view.q.out| 60 
 3 files changed, 72 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/hive/blob/840aa360/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
--
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 
b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index 5044480..ce810c6 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -13446,6 +13446,9 @@ public class SemanticAnalyzer extends 
BaseSemanticAnalyzer {
   Set tableAliases = qb.getTabAliases();
   for (String alias : tableAliases) {
 try {
+  if (DUMMY_TABLE.equals(alias)) {
+continue;
+  }
   Table table = 
this.getTableObjectByName(qb.getTabNameForAlias(alias));
   if (table.isTemporary()) {
 throw new SemanticException("View definition references temporary 
table " + alias);

http://git-wip-us.apache.org/repos/asf/hive/blob/840aa360/ql/src/test/queries/clientpositive/create_view.q
--
diff --git a/ql/src/test/queries/clientpositive/create_view.q 
b/ql/src/test/queries/clientpositive/create_view.q
index 8ac4ae4..cd1e822 100644
--- a/ql/src/test/queries/clientpositive/create_view.q
+++ b/ql/src/test/queries/clientpositive/create_view.q
@@ -227,6 +227,13 @@ DESCRIBE table1_n4;
 -- dependencies for implementing RESTRICT
 
 
+-- create view over literals
+create view view17 as select 1 as v;
+select * from view17;
+create view view18 as select v+1 from (select 1 as v) t;
+select * from view18;
+
+
 DROP VIEW view1;
 DROP VIEW view2;
 DROP VIEW view3;
@@ -243,6 +250,8 @@ DROP VIEW view13;
 DROP VIEW view14;
 DROP VIEW view15;
 DROP VIEW view16;
+DROP VIEW view17;
+DROP VIEW view18;
 DROP TEMPORARY FUNCTION test_translate;
 DROP TEMPORARY FUNCTION test_max;
 DROP TEMPORARY FUNCTION test_explode;

http://git-wip-us.apache.org/repos/asf/hive/blob/840aa360/ql/src/test/results/clientpositive/create_view.q.out
--
diff --git a/ql/src/test/results/clientpositive/create_view.q.out 
b/ql/src/test/results/clientpositive/create_view.q.out
index 02fec1c..d2b8dc1 100644
--- a/ql/src/test/results/clientpositive/create_view.q.out
+++ b/ql/src/test/results/clientpositive/create_view.q.out
@@ -1581,6 +1581,50 @@ POSTHOOK: type: DESCTABLE
 POSTHOOK: Input: default@table1_n4
 keyint 
 value  string  
+PREHOOK: query: create view view17 as select 1 as v
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: database:default
+PREHOOK: Output: default@view17
+POSTHOOK: query: create view view17 as select 1 as v
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@view17
+POSTHOOK: Lineage: view17.v SIMPLE []
+PREHOOK: query: select * from view17
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Input: default@view17
+ A masked pattern was here 
+POSTHOOK: query: select * from view17
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Input: default@view17
+ A masked pattern was here 
+1
+PREHOOK: query: create view view18 as select v+1 from (select 1 as v) t
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: database:default
+PREHOOK: Output: default@view18
+POSTHOOK: query: create view view18 as select v+1 from (select 1 as v) t
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: database:default
+POSTHOOK: