[ https://issues.apache.org/jira/browse/HIVE-23216?focusedWorklogId=427119&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-427119 ]
ASF GitHub Bot logged work on HIVE-23216: ----------------------------------------- Author: ASF GitHub Bot Created on: 24/Apr/20 22:37 Start Date: 24/Apr/20 22:37 Worklog Time Spent: 10m Work Description: jcamachor commented on a change in pull request #990: URL: https://github.com/apache/hive/pull/990#discussion_r414900828 ########## File path: standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java ########## @@ -1941,6 +1941,45 @@ public boolean listPartitionsByExpr(String catName, String db_name, String tbl_n return !r.isSetHasUnknownPartitions() || r.isHasUnknownPartitions(); // Assume the worst. } + @Override + public boolean listPartitionsSpecByExpr(String dbName, String tblName, + byte[] expr, String defaultPartName, short maxParts, List<PartitionSpec> result) + throws TException { + return listPartitionsSpecByExpr(getDefaultCatalog(conf), dbName, tblName, expr, defaultPartName, + maxParts, result); + } + + @Override + public boolean listPartitionsSpecByExpr(String catName, String dbName, String tblName, byte[] expr, + String defaultPartitionName, short maxParts, List<PartitionSpec> result) + throws TException { + assert result != null; + PartitionsByExprRequest req = new PartitionsByExprRequest( + dbName, tblName, ByteBuffer.wrap(expr)); + if (defaultPartitionName != null) { + req.setDefaultPartitionName(defaultPartitionName); + } + if (maxParts >= 0) { + req.setMaxParts(maxParts); + } + PartitionsSpecByExprResult r; + try { + r = client.get_partitions_spec_by_expr(req); + } catch (TApplicationException te) { + if (te.getType() != TApplicationException.UNKNOWN_METHOD + && te.getType() != TApplicationException.WRONG_METHOD_NAME) { + throw te; + } + throw new IncompatibleMetastoreException( + "Metastore doesn't support listPartitionsByExpr: " + te.getMessage()); + } + + //TODO: filtering if client side filtering isClientFilterEnabled on Review comment: My understanding is that those hooks are used for authorization purposes so it is important that we include a new method in `MetaStoreFilterHook` and these partitions pass through that filter; the default implementation does not filter anything indeed. ---------------------------------------------------------------- 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: 427119) Time Spent: 50m (was: 40m) > Add new api as replacement of get_partitions_by_expr to return PartitionSpec > instead of Partitions > -------------------------------------------------------------------------------------------------- > > Key: HIVE-23216 > URL: https://issues.apache.org/jira/browse/HIVE-23216 > Project: Hive > Issue Type: Improvement > Components: Metastore > Affects Versions: 4.0.0 > Reporter: Vineet Garg > Assignee: Vineet Garg > Priority: Major > Attachments: HIVE-23216.1.patch, HIVE-23216.2.patch, > HIVE-23216.3.patch, HIVE-23216.4.patch, HIVE-23216.5.patch, > HIVE-23216.6.patch, HIVE-23216.7.patch > > Time Spent: 50m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)