You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by mi...@apache.org on 2017/09/19 21:31:55 UTC

[12/12] hive git commit: HIVE-17466: Metastore API to list unique partition-key-value combinations. (Thiruvel Thirumoolan, reviewed by Mithun Radhakrishnan)

HIVE-17466: Metastore API to list unique partition-key-value combinations. (Thiruvel Thirumoolan, reviewed by Mithun Radhakrishnan)


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

Branch: refs/heads/branch-2
Commit: dec4efd3c5d7bbfeb56660b97393b08d747af6c4
Parents: 15adcd6
Author: Mithun RK <mi...@apache.org>
Authored: Tue Sep 19 14:31:15 2017 -0700
Committer: Mithun RK <mi...@apache.org>
Committed: Tue Sep 19 14:31:15 2017 -0700

----------------------------------------------------------------------
 .../listener/DummyRawStoreFailEvent.java        |    7 +
 metastore/if/hive_metastore.thrift              |   22 +
 .../gen/thrift/gen-cpp/ThriftHiveMetastore.cpp  | 2497 ++++---
 .../gen/thrift/gen-cpp/ThriftHiveMetastore.h    |  142 +
 .../ThriftHiveMetastore_server.skeleton.cpp     |    5 +
 .../gen/thrift/gen-cpp/hive_metastore_types.cpp | 2349 ++++---
 .../gen/thrift/gen-cpp/hive_metastore_types.h   |  181 +
 .../hive/metastore/api/AbortTxnsRequest.java    |   32 +-
 .../metastore/api/AddDynamicPartitions.java     |   32 +-
 .../metastore/api/ClearFileMetadataRequest.java |   32 +-
 .../hive/metastore/api/ClientCapabilities.java  |   32 +-
 .../hive/metastore/api/CompactionRequest.java   |   44 +-
 .../hive/metastore/api/FireEventRequest.java    |   32 +-
 .../hadoop/hive/metastore/api/Function.java     |   36 +-
 .../metastore/api/GetAllFunctionsResponse.java  |   36 +-
 .../api/GetFileMetadataByExprRequest.java       |   32 +-
 .../api/GetFileMetadataByExprResult.java        |   48 +-
 .../metastore/api/GetFileMetadataRequest.java   |   32 +-
 .../metastore/api/GetFileMetadataResult.java    |   44 +-
 .../metastore/api/GetOpenTxnsInfoResponse.java  |   36 +-
 .../hive/metastore/api/GetOpenTxnsResponse.java |   32 +-
 .../hive/metastore/api/GetTablesRequest.java    |   32 +-
 .../hive/metastore/api/GetTablesResult.java     |   36 +-
 .../api/HeartbeatTxnRangeResponse.java          |   64 +-
 .../metastore/api/InsertEventRequestData.java   |   64 +-
 .../hadoop/hive/metastore/api/LockRequest.java  |   36 +-
 .../api/NotificationEventResponse.java          |   36 +-
 .../hive/metastore/api/OpenTxnsResponse.java    |   32 +-
 .../metastore/api/PartitionValuesRequest.java   | 1222 ++++
 .../metastore/api/PartitionValuesResponse.java  |  443 ++
 .../hive/metastore/api/PartitionValuesRow.java  |  438 ++
 .../metastore/api/PutFileMetadataRequest.java   |   64 +-
 .../hive/metastore/api/ShowCompactResponse.java |   36 +-
 .../hive/metastore/api/ShowLocksResponse.java   |   36 +-
 .../hive/metastore/api/ThriftHiveMetastore.java | 6205 ++++++++++--------
 .../gen-php/metastore/ThriftHiveMetastore.php   | 1524 +++--
 .../src/gen/thrift/gen-php/metastore/Types.php  | 1048 ++-
 .../hive_metastore/ThriftHiveMetastore-remote   |    7 +
 .../hive_metastore/ThriftHiveMetastore.py       | 1069 +--
 .../gen/thrift/gen-py/hive_metastore/ttypes.py  |  685 +-
 .../gen/thrift/gen-rb/hive_metastore_types.rb   |   67 +
 .../gen/thrift/gen-rb/thrift_hive_metastore.rb  |   66 +
 .../hadoop/hive/metastore/HiveMetaStore.java    |   11 +
 .../hive/metastore/HiveMetaStoreClient.java     |    6 +
 .../hadoop/hive/metastore/IMetaStoreClient.java |    6 +-
 .../hadoop/hive/metastore/ObjectStore.java      |  246 +
 .../apache/hadoop/hive/metastore/RawStore.java  |    7 +-
 .../hadoop/hive/metastore/hbase/HBaseStore.java |    6 +
 .../DummyRawStoreControlledCommit.java          |    8 +-
 .../DummyRawStoreForJdoConnection.java          |    8 +-
 50 files changed, 12731 insertions(+), 6480 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/dec4efd3/itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java
----------------------------------------------------------------------
diff --git a/itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java b/itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java
index 74d0efe..9871083 100644
--- a/itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java
+++ b/itests/hcatalog-unit/src/test/java/org/apache/hive/hcatalog/listener/DummyRawStoreFailEvent.java
@@ -34,6 +34,7 @@ import org.apache.hadoop.hive.metastore.api.AggrStats;
 import org.apache.hadoop.hive.metastore.api.ColumnStatistics;
 import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
 import org.apache.hadoop.hive.metastore.api.Database;
+import org.apache.hadoop.hive.metastore.api.FieldSchema;
 import org.apache.hadoop.hive.metastore.api.FileMetadataExprType;
 import org.apache.hadoop.hive.metastore.api.Function;
 import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
@@ -48,6 +49,7 @@ import org.apache.hadoop.hive.metastore.api.NotificationEventRequest;
 import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
 import org.apache.hadoop.hive.metastore.api.Partition;
 import org.apache.hadoop.hive.metastore.api.PartitionEventType;
+import org.apache.hadoop.hive.metastore.api.PartitionValuesResponse;
 import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet;
 import org.apache.hadoop.hive.metastore.api.PrincipalType;
 import org.apache.hadoop.hive.metastore.api.PrivilegeBag;
@@ -281,6 +283,11 @@ public class DummyRawStoreFailEvent implements RawStore, Configurable {
   }
 
   @Override
+  public PartitionValuesResponse listPartitionValues(String db_name, String tbl_name, List<FieldSchema> cols, boolean applyDistinct, String filter, boolean ascending, List<FieldSchema> order, long maxParts) throws MetaException {
+    return null;
+  }
+
+  @Override
   public List<String> listPartitionNamesByFilter(String dbName, String tblName,
                                                  String filter, short maxParts) throws MetaException {
     return objectStore.listPartitionNamesByFilter(dbName, tblName, filter, maxParts);

http://git-wip-us.apache.org/repos/asf/hive/blob/dec4efd3/metastore/if/hive_metastore.thrift
----------------------------------------------------------------------
diff --git a/metastore/if/hive_metastore.thrift b/metastore/if/hive_metastore.thrift
index d056498..8a66bbc 100755
--- a/metastore/if/hive_metastore.thrift
+++ b/metastore/if/hive_metastore.thrift
@@ -589,6 +589,25 @@ struct DropPartitionsRequest {
   8: optional bool needResult=true
 }
 
+struct PartitionValuesRequest {
+  1: required string dbName,
+  2: required string tblName,
+  3: required list<FieldSchema> partitionKeys;
+  4: optional bool applyDistinct = true;
+  5: optional string filter;
+  6: optional list<FieldSchema> partitionOrder;
+  7: optional bool ascending = true;
+  8: optional i64 maxParts = -1;
+}
+
+struct PartitionValuesRow {
+  1: required list<string> row;
+}
+
+struct PartitionValuesResponse {
+  1: required list<PartitionValuesRow> partitionValues;
+}
+
 enum FunctionType {
   JAVA = 1,
 }
@@ -1202,6 +1221,9 @@ service ThriftHiveMetastore extends fb303.FacebookService
   list<string> get_partition_names(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1)
                        throws(1:MetaException o2)
 
+  PartitionValuesResponse get_partition_values(1:PartitionValuesRequest request)
+    throws(1:MetaException o1, 2:NoSuchObjectException o2);
+
   // get_partition*_ps methods allow filtering by a partial partition specification,
   // as needed for dynamic partitions. The values that are not restricted should
   // be empty strings. Nulls were considered (instead of "") but caused errors in