[
https://issues.apache.org/jira/browse/HIVE-17956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16234512#comment-16234512
]
Mithun Radhakrishnan commented on HIVE-17956:
---------------------------------------------
I'm afraid the sort-order is lexicographical, in the order of the keys
specified.
One uncomfortable truth about Hive's metastore is that the concept of "latest"
is alien. The partition key-values are stored internally as strings. Any notion
of data-types for partition keys is a retrofit. Square pegs and round holes.
> Retrieve "latest" partition from Hive Metastore
> -----------------------------------------------
>
> Key: HIVE-17956
> URL: https://issues.apache.org/jira/browse/HIVE-17956
> Project: Hive
> Issue Type: New Feature
> Components: Metastore
> Reporter: Micah Whitacre
>
> We are trying to utilize the Hive Metastore for our processing needs,
> specifically focusing on consuming through the HCatalog APIs. One use case
> we have is that we want to consume the "latest" partition. In researching
> there are a number of posts[1][2] that talk about using queries through Hive
> Server2 to find that information. It would be more ideal if this was a first
> class API offered from the Hive Metastore without requiring a query to be
> executed.
> The other option would be to retrieve all of the partitions and sort client
> side. There is a concern about the efficiency and memory requirements of
> this especially without the "iterator" concept implemented from HIVE-7195.
> [1] -
> https://community.hortonworks.com/questions/85330/how-to-optimize-hive-access-to-the-latest-partitio.html
> [2] -
> https://stackoverflow.com/questions/36095790/how-to-find-the-most-recent-partition-in-hive-table
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)