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

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

                Author: ASF GitHub Bot
            Created on: 05/Jan/21 17:31
            Start Date: 05/Jan/21 17:31
    Worklog Time Spent: 10m 
      Work Description: nrg4878 commented on a change in pull request #1694:
URL: https://github.com/apache/hive/pull/1694#discussion_r552082468



##########
File path: 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestTablesGetExists.java
##########
@@ -555,6 +546,74 @@ public void 
testGetTableObjectsWithProjectionOfMultiValuedFields() throws Except
     }
   }
 
+  @Test
+  public void testGetTableProjectionSpecification() throws Exception {
+    List<String> tableNames = new ArrayList<>();
+    tableNames.add(testTables[0].getTableName());
+    tableNames.add(testTables[1].getTableName());
+
+    GetProjectionsSpec projectSpec = (new GetTableProjectionsSpecBuilder())
+            .includeTableName()
+            .includeDatabase()
+            .includeSdCdColsName()
+            .includeSdCdColsType()
+            .includeSdCdColsComment()
+            .includeSdLocation()
+            .includeSdInputFormat()
+            .includeSdOutputFormat()
+            .includeSdIsCompressed()
+            .includeSdNumBuckets()
+            .includeSdSerDeInfoName()
+            .includeSdSerDeInfoSerializationLib()
+            .includeSdSerDeInfoParameters()
+            .includeSdSerDeInfoDescription()
+            .includeSdSerDeInfoSerializerClass()
+            .includeSdSerDeInfoDeserializerClass()
+            .includeSdSerDeInfoSerdeType()
+            .includeSdBucketCols()
+            .includeSdSortColsCol()
+            .includeSdSortColsOrder()
+            .includeSdparameters()
+            .includeSdSkewedColNames()
+            .includeSdSkewedColValues()
+            .includeSdSkewedColValueLocationMaps()
+            .includeSdIsStoredAsSubDirectories()
+            .includeOwner()
+            .includeOwnerType()
+            .includeCreateTime()
+            .includeLastAccessTime()
+            .includeRetention()
+            .includePartitionKeysName()
+            .includePartitionKeysType()
+            .includePartitionKeysComment()
+            .includeParameters()
+            .includeViewOriginalText()
+            .includeRewriteEnabled()
+            .includeTableType()
+            .build();
+
+    List<Table> tables = client.getTables(null, DEFAULT_DATABASE, tableNames, 
projectSpec);
+
+    Assert.assertEquals("Found tables", 2, tables.size());
+
+    for(Table table : tables) {
+      Assert.assertTrue(table.isSetDbName());
+      Assert.assertTrue(table.isSetCatName());
+      Assert.assertTrue(table.isSetTableName());
+      Assert.assertTrue(table.isSetLastAccessTime());
+      Assert.assertTrue(table.isSetSd());
+      StorageDescriptor sd = table.getSd();
+      Assert.assertTrue(sd.isSetCols());
+      Assert.assertTrue(sd.isSetSerdeInfo());
+      Assert.assertTrue(sd.isSetBucketCols());
+      Assert.assertTrue(sd.isSetCompressed());
+      Assert.assertTrue(sd.isSetInputFormat());
+      Assert.assertTrue(sd.isSetSerdeInfo());
+      SerDeInfo serDeInfo = sd.getSerdeInfo();
+      Assert.assertTrue(serDeInfo.isSetSerializationLib());
+    }
+  }
+

Review comment:
       Could you please add a negative test here as well? Include only a couple 
of fields on the projection spec and test to ensure that some of the other 
fields are not set on the returned Table objects? Thanks




----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 531371)
    Time Spent: 40m  (was: 0.5h)

> Add builder methods for GetTablesRequest and GetPartitionsRequest to 
> HiveMetaStoreClient
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-24386
>                 URL: https://issues.apache.org/jira/browse/HIVE-24386
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Hive
>            Reporter: Narayanan Venkateswaran
>            Assignee: Narayanan Venkateswaran
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Builder methods for GetTablesRequest and GetPartitionsRequest should be added 
> to the HiveMetaStoreClient class.



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

Reply via email to