hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jiraposter@reviews.apache.org (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
Date Tue, 12 Jul 2011 18:30:01 GMT

    [ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064060#comment-13064060
] 

jiraposter@reviews.apache.org commented on HIVE-2226:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/910/
-----------------------------------------------------------

(Updated 2011-07-12 18:29:23.959204)


Review request for hive and Paul Yang.


Changes
-------

added exception for invalid key name


Summary
-------

Create a function listTableNamesByFilter that returns a list of names for tables in a database
that match a certain filter. The syntax of the filter is similar to the one created by HIVE-1609.
You can filter the table list based on owner, last access time, or table parameter key/values.
The filtering takes place at the JDO level for efficiency/speed.  To create a new kind of
table filter, add a constant to thrift.if and a branch in the if statement in generateJDOFilterOverTables()
in ExpressionTree.

Example filter statements include: 
//translation: owner.matches(".*test.*") and lastAccessTime == 0
filter = Constants.HIVE_FILTER_FIELD_OWNER + 
    " like \".*test.*\" and " + 
    Constants.HIVE_FILTER_FIELD_LAST_ACCESS + " = 0";

//translation: owner = "test_user" and (parameters.get("retention") == "30" || parameters.get("retention")
== 90)
filter = Constants.HIVE_FILTER_FIELD_OWNER + 
    " = \"test_user\" and (" + 
    Constants.HIVE_FILTER_FIELD_PARAMS + "retention = \"30\" or " + 
    Constants.HIVE_FILTER_FIELD_PARAMS + "retention = \"90\")"

The filter can currently parse string or integer values, where values interpreted as strings
must be in quotes.  See the comments in IMetaStoreClient for more usage details/restrictions.


This addresses bug HIVE-2226.
    https://issues.apache.org/jira/browse/HIVE-2226


Diffs (updated)
-----

  trunk/metastore/if/hive_metastore.thrift 1145244 
  trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1145244 
  trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java 1145244

  trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java 1145244

  trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 1145244 
  trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java 1145244 
  trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java 1145244

  trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/Filter.g 1145244 
  trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java 1145244


Diff: https://reviews.apache.org/r/910/diff


Testing
-------

Added test cases to TestHiveMetaStore


Thanks,

Sohan



> Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters,
etc.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-2226
>                 URL: https://issues.apache.org/jira/browse/HIVE-2226
>             Project: Hive
>          Issue Type: Improvement
>          Components: Metastore
>            Reporter: Sohan Jain
>            Assignee: Sohan Jain
>         Attachments: HIVE-2226.1.patch
>
>
> Create a function called get_table_names_by_filter that returns a list of table names
in a database that match a certain filter.  The filter should operate similar to the one HIVE-1609.
 Initially, you should be able to prune the table list based on owner, retention, or table
parameter key/values.  The filtering should take place at the JDO level for efficiency/speed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message