[hive] branch revert-1124-HIVE-23493-master-join-back-basic-plan-b created (now 91e2869)

2020-06-16 Thread krisztiankasa
This is an automated email from the ASF dual-hosted git repository.

krisztiankasa pushed a change to branch 
revert-1124-HIVE-23493-master-join-back-basic-plan-b
in repository https://gitbox.apache.org/repos/asf/hive.git.


  at 91e2869  Revert "HIVE-23493: Rewrite plan to join back tables with 
many projected columns joined multiple times (#1124)"

This branch includes the following new commits:

 new 91e2869  Revert "HIVE-23493: Rewrite plan to join back tables with 
many projected columns joined multiple times (#1124)"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[hive] branch master updated: HIVE-23592: Routine makeIntPair is Not Correct (David Mollitor, reviewed by Miklos Gergely)

2020-06-16 Thread dmollitor
This is an automated email from the ASF dual-hosted git repository.

dmollitor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
 new e74029d  HIVE-23592: Routine makeIntPair is Not Correct (David 
Mollitor, reviewed by Miklos Gergely)
e74029d is described below

commit e74029d4fd5c4bfc50d33a8f1155ffacc151ba8f
Author: belugabehr <12578579+belugab...@users.noreply.github.com>
AuthorDate: Tue Jun 16 09:23:19 2020 -0400

HIVE-23592: Routine makeIntPair is Not Correct (David Mollitor, reviewed by 
Miklos Gergely)
---
 .../org/apache/hadoop/hive/common/NumberUtils.java | 60 ++
 .../apache/hadoop/hive/common/TestNumberUtils.java | 57 
 .../hadoop/hive/llap/cache/BuddyAllocator.java | 15 ++
 .../hadoop/hive/ql/io/orc/encoded/IoTrace.java | 16 ++
 4 files changed, 125 insertions(+), 23 deletions(-)

diff --git a/common/src/java/org/apache/hadoop/hive/common/NumberUtils.java 
b/common/src/java/org/apache/hadoop/hive/common/NumberUtils.java
new file mode 100644
index 000..c9fa424
--- /dev/null
+++ b/common/src/java/org/apache/hadoop/hive/common/NumberUtils.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.common;
+
+/**
+ * Collection of {@link Number} manipulation utilities common across Hive.
+ */
+public final class NumberUtils {
+
+  private NumberUtils() {
+  }
+
+  /**
+   * Store two ints in a single long value.
+   *
+   * @param i1 First int to store
+   * @param i2 Second int to store
+   * @return The combined value stored in a long
+   */
+  public static long makeIntPair(int i1, int i2) {
+return (((long) i1) << 32) | (i2 & 0xL);
+  }
+
+  /**
+   * Get the first int stored in a long value.
+   *
+   * @param pair The pair generated from makeIntPair
+   * @return The first value stored in the long
+   */
+  public static int getFirstInt(long pair) {
+return (int) (pair >> 32);
+  }
+
+  /**
+   * Get the second int stored in a long value.
+   *
+   * @param pair The pair generated from makeIntPair
+   * @return The first value stored in the long
+   */
+  public static int getSecondInt(long pair) {
+return (int) pair;
+  }
+
+}
diff --git a/common/src/test/org/apache/hadoop/hive/common/TestNumberUtils.java 
b/common/src/test/org/apache/hadoop/hive/common/TestNumberUtils.java
new file mode 100644
index 000..c370dbd
--- /dev/null
+++ b/common/src/test/org/apache/hadoop/hive/common/TestNumberUtils.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.common;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test suite for the {@link NumberUtils} class.
+ */
+public class TestNumberUtils {
+
+  @Test
+  public void testMinLong() {
+final long pair = NumberUtils.makeIntPair(Integer.MIN_VALUE, 
Integer.MIN_VALUE);
+Assert.assertEquals(Integer.MIN_VALUE, NumberUtils.getFirstInt(pair));
+Assert.assertEquals(Integer.MIN_VALUE, NumberUtils.getSecondInt(pair));
+  }
+
+  @Test
+  public void testMaxLong() {
+final long pair = NumberUtils.makeIntPair(Integer.MAX_VALUE, 
Integer.MAX_VALUE);
+Assert.assertEquals(Integer.MAX_VALUE, NumberUtils.getFirstInt(pair));
+Assert.assertEquals(Integer.MAX_VALUE, NumberUtils.getSecondInt(pair));
+  }
+
+  @Test
+  

[hive] branch master updated (8208df9 -> c7f23df)

2020-06-16 Thread pvary
This is an automated email from the ASF dual-hosted git repository.

pvary pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git.


from 8208df9  HIVE-21952 : Allow unsetting of serde properties (Miklos 
Gergely, reviewed by David Mollitor)
 add c7f23df  HIVE-23683: Add enqueue time to compaction (Peter Vary 
reviewed by Karen Coppage and Laszlo Pinter)

No new revisions were added by this update.

Summary of changes:
 .../upgrade/hive/hive-schema-4.0.0.hive.sql|   9 ++
 .../upgrade/hive/upgrade-3.1.0-to-4.0.0.hive.sql   |   9 ++
 .../show/compactions/ShowCompactionsDesc.java  |   4 +-
 .../show/compactions/ShowCompactionsOperation.java |   4 +
 .../metastore/txn/TestCompactionTxnHandler.java|  59 
 .../queries/clientpositive/dbtxnmgr_showlocks.q|   2 +
 ql/src/test/queries/clientpositive/sysdb.q |   2 +
 .../clientpositive/llap/dbtxnmgr_showlocks.q.out   |   4 +-
 .../test/results/clientpositive/llap/sysdb.q.out   |  12 ++-
 .../hive/metastore/api/CompactionInfoStruct.java   | 107 -
 .../metastore/api/ShowCompactResponseElement.java  | 107 -
 .../src/gen/thrift/gen-php/metastore/Types.php |  46 +
 .../src/gen/thrift/gen-py/hive_metastore/ttypes.py |  30 +-
 .../src/gen/thrift/gen-rb/hive_metastore_types.rb  |   8 +-
 .../src/main/thrift/hive_metastore.thrift  |   2 +
 .../hadoop/hive/metastore/txn/CompactionInfo.java  |   9 ++
 .../hive/metastore/txn/CompactionTxnHandler.java   |  15 +--
 .../hadoop/hive/metastore/txn/TxnHandler.java  |  16 ++-
 .../src/main/sql/derby/hive-schema-4.0.0.derby.sql |   2 +
 .../sql/derby/upgrade-3.2.0-to-4.0.0.derby.sql |   4 +
 .../src/main/sql/mssql/hive-schema-4.0.0.mssql.sql |   2 +
 .../sql/mssql/upgrade-3.2.0-to-4.0.0.mssql.sql |   4 +
 .../src/main/sql/mysql/hive-schema-4.0.0.mysql.sql |   2 +
 .../sql/mysql/upgrade-3.2.0-to-4.0.0.mysql.sql |   4 +
 .../main/sql/oracle/hive-schema-4.0.0.oracle.sql   |   2 +
 .../sql/oracle/upgrade-3.2.0-to-4.0.0.oracle.sql   |   4 +
 .../sql/postgres/hive-schema-4.0.0.postgres.sql|   2 +
 .../postgres/upgrade-3.2.0-to-4.0.0.postgres.sql   |   4 +
 28 files changed, 445 insertions(+), 30 deletions(-)



[hive] branch master updated: HIVE-21952 : Allow unsetting of serde properties (Miklos Gergely, reviewed by David Mollitor)

2020-06-16 Thread mgergely
This is an automated email from the ASF dual-hosted git repository.

mgergely pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
 new 8208df9  HIVE-21952 : Allow unsetting of serde properties (Miklos 
Gergely, reviewed by David Mollitor)
8208df9 is described below

commit 8208df93b465bfa829052fd042a43d89bab86c31
Author: Miklos Gergely 
AuthorDate: Tue Jun 16 09:45:33 2020 +0200

HIVE-21952 : Allow unsetting of serde properties (Miklos Gergely, reviewed 
by David Mollitor)
---
 .../cli/SemanticAnalysis/HCatSemanticAnalyzer.java |   6 +-
 .../org/apache/hadoop/hive/ql/parse/HiveParser.g   |  15 ++-
 .../serde/AlterTableSetSerdePropsAnalyzer.java |   2 +-
 ...java => AlterTableUnsetSerdePropsAnalyzer.java} |  10 +-
 .../serde/AlterTableUnsetSerdePropsDesc.java   |  46 +++
 .../serde/AlterTableUnsetSerdePropsOperation.java  |  43 +++
 .../apache/hadoop/hive/ql/plan/HiveOperation.java  |   6 +-
 ql/src/test/queries/clientpositive/table_storage.q |  14 +++
 .../clientpositive/llap/table_storage.q.out| 137 +
 9 files changed, 264 insertions(+), 15 deletions(-)

diff --git 
a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 
b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
index cd54e28..941f6b8 100644
--- 
a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
+++ 
b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
@@ -127,7 +127,8 @@ public class HCatSemanticAnalyzer extends 
HCatSemanticAnalyzerBase {
 case HiveParser.TOK_ALTERTABLE_ADDPARTS:
 case HiveParser.TOK_ALTERTABLE_ADDCOLS:
 case HiveParser.TOK_ALTERTABLE_CHANGECOL_AFTER_POSITION:
-case HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES:
+case HiveParser.TOK_ALTERTABLE_SETSERDEPROPERTIES:
+case HiveParser.TOK_ALTERTABLE_UNSETSERDEPROPERTIES:
 case HiveParser.TOK_ALTERTABLE_CLUSTER_SORT:
 case HiveParser.TOK_ALTERTABLE_DROPPARTS:
 case HiveParser.TOK_ALTERTABLE_PROPERTIES:
@@ -212,7 +213,8 @@ public class HCatSemanticAnalyzer extends 
HCatSemanticAnalyzerBase {
   case HiveParser.TOK_ALTERTABLE_ADDPARTS:
   case HiveParser.TOK_ALTERTABLE_ADDCOLS:
   case HiveParser.TOK_ALTERTABLE_CHANGECOL_AFTER_POSITION:
-  case HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES:
+  case HiveParser.TOK_ALTERTABLE_SETSERDEPROPERTIES:
+  case HiveParser.TOK_ALTERTABLE_UNSETSERDEPROPERTIES:
   case HiveParser.TOK_ALTERTABLE_CLUSTER_SORT:
   case HiveParser.TOK_ALTERTABLE_DROPPARTS:
   case HiveParser.TOK_ALTERTABLE_PROPERTIES:
diff --git a/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 
b/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
index 768a3a1..0f9caae 100644
--- a/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
+++ b/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
@@ -172,8 +172,10 @@ TOK_ALTERPARTITION_MERGEFILES;
 TOK_ALTERTABLE_TOUCH;
 TOK_ALTERTABLE_ARCHIVE;
 TOK_ALTERTABLE_UNARCHIVE;
-TOK_ALTERTABLE_SERDEPROPERTIES;
-TOK_ALTERPARTITION_SERDEPROPERTIES;
+TOK_ALTERTABLE_SETSERDEPROPERTIES;
+TOK_ALTERPARTITION_SETSERDEPROPERTIES;
+TOK_ALTERTABLE_UNSETSERDEPROPERTIES;
+TOK_ALTERPARTITION_UNSETSERDEPROPERTIES;
 TOK_ALTERTABLE_SERIALIZER;
 TOK_ALTERPARTITION_SERIALIZER;
 TOK_ALTERTABLE_UPDATECOLSTATS;
@@ -1452,14 +1454,17 @@ alterViewSuffixProperties
 ;
 
 alterStatementSuffixSerdeProperties[boolean partition]
-@init { pushMsg("alter serdes statement", state); }
+@init { pushMsg("alter serde statement", state); }
 @after { popMsg(state); }
 : KW_SET KW_SERDE serdeName=StringLiteral (KW_WITH KW_SERDEPROPERTIES 
tableProperties)?
 -> {partition}? ^(TOK_ALTERPARTITION_SERIALIZER $serdeName 
tableProperties?)
 ->  ^(TOK_ALTERTABLE_SERIALIZER $serdeName tableProperties?)
 | KW_SET KW_SERDEPROPERTIES tableProperties
--> {partition}? ^(TOK_ALTERPARTITION_SERDEPROPERTIES tableProperties)
-->  ^(TOK_ALTERTABLE_SERDEPROPERTIES tableProperties)
+-> {partition}? ^(TOK_ALTERPARTITION_SETSERDEPROPERTIES tableProperties)
+->  ^(TOK_ALTERTABLE_SETSERDEPROPERTIES tableProperties)
+| KW_UNSET KW_SERDEPROPERTIES tableProperties
+-> {partition}? ^(TOK_ALTERPARTITION_UNSETSERDEPROPERTIES tableProperties)
+->  ^(TOK_ALTERTABLE_UNSETSERDEPROPERTIES tableProperties)
 ;
 
 tablePartitionPrefix
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/serde/AlterTableSetSerdePropsAnalyzer.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/serde/AlterTableSetSerdePropsAnalyzer.java
index 2be5dc6..16453e1 100644
--- 

[hive] branch master updated: HIVE-21952 : Allow unsetting of serde properties (Miklos Gergely, reviewed by David Mollitor)

2020-06-16 Thread mgergely
This is an automated email from the ASF dual-hosted git repository.

mgergely pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
 new 8208df9  HIVE-21952 : Allow unsetting of serde properties (Miklos 
Gergely, reviewed by David Mollitor)
8208df9 is described below

commit 8208df93b465bfa829052fd042a43d89bab86c31
Author: Miklos Gergely 
AuthorDate: Tue Jun 16 09:45:33 2020 +0200

HIVE-21952 : Allow unsetting of serde properties (Miklos Gergely, reviewed 
by David Mollitor)
---
 .../cli/SemanticAnalysis/HCatSemanticAnalyzer.java |   6 +-
 .../org/apache/hadoop/hive/ql/parse/HiveParser.g   |  15 ++-
 .../serde/AlterTableSetSerdePropsAnalyzer.java |   2 +-
 ...java => AlterTableUnsetSerdePropsAnalyzer.java} |  10 +-
 .../serde/AlterTableUnsetSerdePropsDesc.java   |  46 +++
 .../serde/AlterTableUnsetSerdePropsOperation.java  |  43 +++
 .../apache/hadoop/hive/ql/plan/HiveOperation.java  |   6 +-
 ql/src/test/queries/clientpositive/table_storage.q |  14 +++
 .../clientpositive/llap/table_storage.q.out| 137 +
 9 files changed, 264 insertions(+), 15 deletions(-)

diff --git 
a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 
b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
index cd54e28..941f6b8 100644
--- 
a/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
+++ 
b/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
@@ -127,7 +127,8 @@ public class HCatSemanticAnalyzer extends 
HCatSemanticAnalyzerBase {
 case HiveParser.TOK_ALTERTABLE_ADDPARTS:
 case HiveParser.TOK_ALTERTABLE_ADDCOLS:
 case HiveParser.TOK_ALTERTABLE_CHANGECOL_AFTER_POSITION:
-case HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES:
+case HiveParser.TOK_ALTERTABLE_SETSERDEPROPERTIES:
+case HiveParser.TOK_ALTERTABLE_UNSETSERDEPROPERTIES:
 case HiveParser.TOK_ALTERTABLE_CLUSTER_SORT:
 case HiveParser.TOK_ALTERTABLE_DROPPARTS:
 case HiveParser.TOK_ALTERTABLE_PROPERTIES:
@@ -212,7 +213,8 @@ public class HCatSemanticAnalyzer extends 
HCatSemanticAnalyzerBase {
   case HiveParser.TOK_ALTERTABLE_ADDPARTS:
   case HiveParser.TOK_ALTERTABLE_ADDCOLS:
   case HiveParser.TOK_ALTERTABLE_CHANGECOL_AFTER_POSITION:
-  case HiveParser.TOK_ALTERTABLE_SERDEPROPERTIES:
+  case HiveParser.TOK_ALTERTABLE_SETSERDEPROPERTIES:
+  case HiveParser.TOK_ALTERTABLE_UNSETSERDEPROPERTIES:
   case HiveParser.TOK_ALTERTABLE_CLUSTER_SORT:
   case HiveParser.TOK_ALTERTABLE_DROPPARTS:
   case HiveParser.TOK_ALTERTABLE_PROPERTIES:
diff --git a/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 
b/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
index 768a3a1..0f9caae 100644
--- a/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
+++ b/parser/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
@@ -172,8 +172,10 @@ TOK_ALTERPARTITION_MERGEFILES;
 TOK_ALTERTABLE_TOUCH;
 TOK_ALTERTABLE_ARCHIVE;
 TOK_ALTERTABLE_UNARCHIVE;
-TOK_ALTERTABLE_SERDEPROPERTIES;
-TOK_ALTERPARTITION_SERDEPROPERTIES;
+TOK_ALTERTABLE_SETSERDEPROPERTIES;
+TOK_ALTERPARTITION_SETSERDEPROPERTIES;
+TOK_ALTERTABLE_UNSETSERDEPROPERTIES;
+TOK_ALTERPARTITION_UNSETSERDEPROPERTIES;
 TOK_ALTERTABLE_SERIALIZER;
 TOK_ALTERPARTITION_SERIALIZER;
 TOK_ALTERTABLE_UPDATECOLSTATS;
@@ -1452,14 +1454,17 @@ alterViewSuffixProperties
 ;
 
 alterStatementSuffixSerdeProperties[boolean partition]
-@init { pushMsg("alter serdes statement", state); }
+@init { pushMsg("alter serde statement", state); }
 @after { popMsg(state); }
 : KW_SET KW_SERDE serdeName=StringLiteral (KW_WITH KW_SERDEPROPERTIES 
tableProperties)?
 -> {partition}? ^(TOK_ALTERPARTITION_SERIALIZER $serdeName 
tableProperties?)
 ->  ^(TOK_ALTERTABLE_SERIALIZER $serdeName tableProperties?)
 | KW_SET KW_SERDEPROPERTIES tableProperties
--> {partition}? ^(TOK_ALTERPARTITION_SERDEPROPERTIES tableProperties)
-->  ^(TOK_ALTERTABLE_SERDEPROPERTIES tableProperties)
+-> {partition}? ^(TOK_ALTERPARTITION_SETSERDEPROPERTIES tableProperties)
+->  ^(TOK_ALTERTABLE_SETSERDEPROPERTIES tableProperties)
+| KW_UNSET KW_SERDEPROPERTIES tableProperties
+-> {partition}? ^(TOK_ALTERPARTITION_UNSETSERDEPROPERTIES tableProperties)
+->  ^(TOK_ALTERTABLE_UNSETSERDEPROPERTIES tableProperties)
 ;
 
 tablePartitionPrefix
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/serde/AlterTableSetSerdePropsAnalyzer.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/serde/AlterTableSetSerdePropsAnalyzer.java
index 2be5dc6..16453e1 100644
---