[ 
https://issues.apache.org/jira/browse/HIVE-24370?focusedWorklogId=510961&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-510961
 ]

ASF GitHub Bot logged work on HIVE-24370:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Nov/20 18:24
            Start Date: 12/Nov/20 18:24
    Worklog Time Spent: 10m 
      Work Description: vihangk1 commented on a change in pull request #1664:
URL: https://github.com/apache/hive/pull/1664#discussion_r522319043



##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
##########
@@ -4664,6 +4664,58 @@ public void dropStoredProcedure(StoredProcedureRequest 
request) throws MetaExcep
     return client.get_all_stored_procedures(request);
   }
 
+  /**
+   * Builder for the GetProjectionsSpec. This is a projection specification 
for partitions returned from the HMS.
+   */
+  public static class GetPartitionProjectionsSpecBuilder {
+
+    java.util.List<java.lang.String> partitionList = null;

Review comment:
       Can we mark these fields as private? Any particular reason they are 
package private?

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
##########
@@ -4664,6 +4664,58 @@ public void dropStoredProcedure(StoredProcedureRequest 
request) throws MetaExcep
     return client.get_all_stored_procedures(request);
   }
 
+  /**
+   * Builder for the GetProjectionsSpec. This is a projection specification 
for partitions returned from the HMS.
+   */
+  public static class GetPartitionProjectionsSpecBuilder {
+
+    java.util.List<java.lang.String> partitionList = null;
+    java.lang.String includePartitionPattern = null;
+    java.lang.String excludePartitionPattern = null;
+
+    public void setPartitionList(List<String> partitionList) {
+      this.partitionList = partitionList;
+    }
+
+    public void setIncludePartitionPattern(String includePartitionPattern) {
+      this.includePartitionPattern = includePartitionPattern;
+    }
+
+    public void setExcludePartitionPattern(String excludePartitionPattern) {
+      this.excludePartitionPattern = excludePartitionPattern;
+    }
+
+    public GetProjectionsSpec build() {
+      return new GetProjectionsSpec(partitionList, includePartitionPattern, 
excludePartitionPattern);
+    }
+  }
+
+  /**
+   * Builder for the GetProjectionsSpec. This is a projection specification 
for tables returned from the HMS.
+   */
+  public static class GetTableProjectionsSpecBuilder {
+
+    java.util.List<java.lang.String> columnList = null;

Review comment:
       nit, no need to use fully qualified List here. also for String. Same for 
the earlier builder class as well. Please make these fields private.

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
##########
@@ -4664,6 +4664,58 @@ public void dropStoredProcedure(StoredProcedureRequest 
request) throws MetaExcep
     return client.get_all_stored_procedures(request);
   }
 
+  /**
+   * Builder for the GetProjectionsSpec. This is a projection specification 
for partitions returned from the HMS.
+   */
+  public static class GetPartitionProjectionsSpecBuilder {

Review comment:
       From a user perspective, I think it would be more user friendly to have 
builder class for the whole request objects (eg. GetPartitionsRequestBuilder 
which gives ability to create a projection and filter spec)

##########
File path: 
standalone-metastore/metastore-common/src/main/thrift/hive_metastore.thrift
##########
@@ -1979,7 +1979,7 @@ struct GetPartitionsRequest {
    4: optional bool withAuth,
    5: optional string user,
    6: optional list<string> groupNames,
-   7: GetPartitionsProjectionSpec projectionSpec
+   7: GetProjectionsSpec projectionSpec
    8: GetPartitionsFilterSpec filterSpec, // TODO not yet implemented. Must be 
present but ignored

Review comment:
       Not related to your change, but looks like that TODO should be removed 
since we have the filterspec implemented.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 510961)
    Time Spent: 1h  (was: 50m)

> Make the GetPartitionsProjectionSpec generic and add builder methods for 
> tables and partitions in HiveMetaStoreClient
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-24370
>                 URL: https://issues.apache.org/jira/browse/HIVE-24370
>             Project: Hive
>          Issue Type: Task
>            Reporter: Narayanan Venkateswaran
>            Assignee: Narayanan Venkateswaran
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> HIVE-20306 defines a projection struct called GetPartitionsProjectionSpec 
> While the name has Partition in its name, this is a fairly generic struct 
> with nothing specific to partitions. This should be renamed to a more generic 
> name (GetProjectionSpec ?) and builder methods of this class for tables and 
> partitions must be added to HiveMetaStoreClient.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to