[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13071291#comment-13071291 ] Paul Yang commented on HIVE-2226: - Committed. 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 Fix For: 0.8.0 Attachments: HIVE-2226.1.patch, HIVE-2226.3.patch, HIVE-2226.4.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
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13071426#comment-13071426 ] Hudson commented on HIVE-2226: -- Integrated in Hive-trunk-h0.21 #851 (See [https://builds.apache.org/job/Hive-trunk-h0.21/851/]) HIVE-2226. Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc. (Sohan Jain via pauly) pauly : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1151213 Files : * /hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java * /hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Constants.java * /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java * /hive/trunk/metastore/if/hive_metastore.thrift * /hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote * /hive/trunk/metastore/src/gen/thrift/gen-php/hive_metastore/hive_metastore_constants.php * /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/Filter.g * /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java * /hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_constants.cpp * /hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp * /hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py * /hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_constants.rb * /hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_constants.h * /hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/constants.py * /hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp * /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java * /hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h * /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java * /hive/trunk/metastore/src/gen/thrift/gen-php/hive_metastore/ThriftHiveMetastore.php * /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java * /hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java * /hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java * /hive/trunk/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb 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 Fix For: 0.8.0 Attachments: HIVE-2226.1.patch, HIVE-2226.3.patch, HIVE-2226.4.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
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13070875#comment-13070875 ] Paul Yang commented on HIVE-2226: - +1 Will test and commit 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, HIVE-2226.3.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
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13064060#comment-13064060 ] jirapos...@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
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13058117#comment-13058117 ] jirapos...@reviews.apache.org commented on HIVE-2226: - --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/910/#review928 --- trunk/metastore/if/hive_metastore.thrift https://reviews.apache.org/r/910/#comment2014 Using the form hive_filter_field_params__parameter key seems a little odd. Can't think of an easy way to handle this case though, so it should probably be okay. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java https://reviews.apache.org/r/910/#comment2003 I don't think it's possible to create 2 tables with the same name. In which case, there shouldn't be a need for this check. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java https://reviews.apache.org/r/910/#comment2005 We should catch the case where the keyName is invalid - Paul On 2011-06-20 21:04:45, Sohan Jain wrote: bq. bq. --- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/910/ bq. --- bq. bq. (Updated 2011-06-20 21:04:45) bq. bq. bq. Review request for hive and Paul Yang. bq. bq. bq. Summary bq. --- bq. bq. 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. bq. bq. Example filter statements include: bq. //translation: owner.matches(.*test.*) and lastAccessTime == 0 bq. filter = Constants.HIVE_FILTER_FIELD_OWNER + bq. like \.*test.*\ and + bq. Constants.HIVE_FILTER_FIELD_LAST_ACCESS + = 0; bq. bq. //translation: owner = test_user and (parameters.get(retention) == 30 || parameters.get(retention) == 90) bq. filter = Constants.HIVE_FILTER_FIELD_OWNER + bq. = \test_user\ and ( + bq. Constants.HIVE_FILTER_FIELD_PARAMS + retention = \30\ or + bq. Constants.HIVE_FILTER_FIELD_PARAMS + retention = \90\) bq. bq. 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. bq. bq. bq. This addresses bug HIVE-2226. bq. https://issues.apache.org/jira/browse/HIVE-2226 bq. bq. bq. Diffs bq. - bq. bq.trunk/metastore/if/hive_metastore.thrift 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 1136751 bq.trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/Filter.g 1136751 bq. trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java 1136751 bq. bq. Diff: https://reviews.apache.org/r/910/diff bq. bq. bq. Testing bq. --- bq. bq. Added test cases to TestHiveMetaStore bq. bq. bq. Thanks, bq. bq. Sohan bq. bq. 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
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13058137#comment-13058137 ] jirapos...@reviews.apache.org commented on HIVE-2226: - bq. On 2011-06-30 22:48:12, Paul Yang wrote: bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java, lines 1533-1537 bq. https://reviews.apache.org/r/910/diff/2/?file=21391#file21391line1533 bq. bq. I don't think it's possible to create 2 tables with the same name. In which case, there shouldn't be a need for this check. Ah, the comment there is a little misleading. Some tables were getting returned multiple times if they matched multiple parts of an OR clause. For example, in the unit test with the filter string: owner = testOwner1 (lastAccessTime = 30 || test_param_1 = hi), a table which had owner=testOwner1, lastAccessTime = 30, and test_param_1 = hi was returned twice by the query. bq. On 2011-06-30 22:48:12, Paul Yang wrote: bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java, lines 187-188 bq. https://reviews.apache.org/r/910/diff/2/?file=21393#file21393line187 bq. bq. We should catch the case where the keyName is invalid Will do - Sohan --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/910/#review928 --- On 2011-06-20 21:04:45, Sohan Jain wrote: bq. bq. --- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/910/ bq. --- bq. bq. (Updated 2011-06-20 21:04:45) bq. bq. bq. Review request for hive and Paul Yang. bq. bq. bq. Summary bq. --- bq. bq. 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. bq. bq. Example filter statements include: bq. //translation: owner.matches(.*test.*) and lastAccessTime == 0 bq. filter = Constants.HIVE_FILTER_FIELD_OWNER + bq. like \.*test.*\ and + bq. Constants.HIVE_FILTER_FIELD_LAST_ACCESS + = 0; bq. bq. //translation: owner = test_user and (parameters.get(retention) == 30 || parameters.get(retention) == 90) bq. filter = Constants.HIVE_FILTER_FIELD_OWNER + bq. = \test_user\ and ( + bq. Constants.HIVE_FILTER_FIELD_PARAMS + retention = \30\ or + bq. Constants.HIVE_FILTER_FIELD_PARAMS + retention = \90\) bq. bq. 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. bq. bq. bq. This addresses bug HIVE-2226. bq. https://issues.apache.org/jira/browse/HIVE-2226 bq. bq. bq. Diffs bq. - bq. bq.trunk/metastore/if/hive_metastore.thrift 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 1136751 bq.trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java 1136751 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/Filter.g 1136751 bq. trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java 1136751 bq. bq. Diff: https://reviews.apache.org/r/910/diff bq. bq. bq. Testing bq. --- bq. bq. Added test cases to TestHiveMetaStore bq. bq. bq. Thanks, bq. bq. Sohan bq. bq. 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
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13052219#comment-13052219 ] jirapos...@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-06-20 21:04:45.477266) Review request for hive and Paul Yang. Changes --- - Removed the TableQueryFilterType enum. Instead, use constant names for filter keys to allow mixing filter types. Summary (updated) --- 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 1136751 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1136751 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java 1136751 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java 1136751 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 1136751 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java 1136751 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java 1136751 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/Filter.g 1136751 trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java 1136751 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
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13050821#comment-13050821 ] jirapos...@reviews.apache.org commented on HIVE-2226: - --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/910/#review855 --- trunk/metastore/if/hive_metastore.thrift https://reviews.apache.org/r/910/#comment1868 Can we rename this to TableQueryFilterType so that it's clear that it's only used for tables? trunk/metastore/if/hive_metastore.thrift https://reviews.apache.org/r/910/#comment1864 Where is this used? trunk/metastore/if/hive_metastore.thrift https://reviews.apache.org/r/910/#comment1866 Hive doesn't really use the retention field. Can you remove operations on this field from the rest of the diff? trunk/metastore/if/hive_metastore.thrift https://reviews.apache.org/r/910/#comment1869 The interface is a little odd because we have to use names like 'owner' or 'retention' in addition to specifying the QueryFilterType. Maybe we should make the field that the QueryFilterType references be called 'field', so you'd have a filter like 'field = .*test_user.*' (for owner) or 'field 90' (for retention) trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java https://reviews.apache.org/r/910/#comment1867 Style issue, { should be on same line as if trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java https://reviews.apache.org/r/910/#comment1870 JDO-174 looks like it was fixed a while back - is this still an issue? bq. and may be useful operators for the the parameters field. (e.g. if retention were stored there instead of the member field) - Paul On 2011-06-16 03:13:24, Sohan Jain wrote: bq. bq. --- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/910/ bq. --- bq. bq. (Updated 2011-06-16 03:13:24) bq. bq. bq. Review request for hive and Paul Yang. bq. bq. bq. Summary bq. --- bq. bq. 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, retention, or table parameter key/values. The filtering takes place at the JDO level for efficiency/speed. Added a QueryFilterType enum to easily add new filters and separate logic for filtering. bq. bq. Example filter statements include: bq. filterType = QueryFilterType.OWNER; filter = owner like .*test_user.* bq. filterType = QueryFilterType.RETENTION; filter = retention 90 and retention 30 bq. filterType = QueryFilterType.PARAMS; filter = numPartitions = \2\ and retention_days = \30\ bq. bq. The filter can currently parse string or integer values, where values interpreted as strings must be in quotes. bq. bq. bq. This addresses bug HIVE-2226. bq. https://issues.apache.org/jira/browse/HIVE-2226 bq. bq. bq. Diffs bq. - bq. bq.trunk/metastore/if/hive_metastore.thrift 1135227 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1135227 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java 1135227 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java 1135227 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 1135227 bq.trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java 1135227 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java 1135227 bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/Filter.g 1135227 bq. trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java 1135227 bq. bq. Diff: https://reviews.apache.org/r/910/diff bq. bq. bq. Testing bq. --- bq. bq. Added test cases to TestHiveMetaStore bq. bq. bq. Thanks, bq. bq. Sohan bq. bq. 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
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13050830#comment-13050830 ] jirapos...@reviews.apache.org commented on HIVE-2226: - bq. On 2011-06-17 00:13:20, Paul Yang wrote: bq. trunk/metastore/if/hive_metastore.thrift, line 46 bq. https://reviews.apache.org/r/910/diff/1/?file=21192#file21192line46 bq. bq. Can we rename this to TableQueryFilterType so that it's clear that it's only used for tables? Sure thing. bq. On 2011-06-17 00:13:20, Paul Yang wrote: bq. trunk/metastore/if/hive_metastore.thrift, line 53 bq. https://reviews.apache.org/r/910/diff/1/?file=21192#file21192line53 bq. bq. Where is this used? Ah, that's not supposed to be there; I will remove it. bq. On 2011-06-17 00:13:20, Paul Yang wrote: bq. trunk/metastore/if/hive_metastore.thrift, lines 267-270 bq. https://reviews.apache.org/r/910/diff/1/?file=21192#file21192line267 bq. bq. Hive doesn't really use the retention field. Can you remove operations on this field from the rest of the diff? Yep. bq. On 2011-06-17 00:13:20, Paul Yang wrote: bq. trunk/metastore/if/hive_metastore.thrift, line 277 bq. https://reviews.apache.org/r/910/diff/1/?file=21192#file21192line277 bq. bq. The interface is a little odd because we have to use names like 'owner' or 'retention' in addition to specifying the QueryFilterType. Maybe we should make the field that the QueryFilterType references be called 'field', so you'd have a filter like 'field = .*test_user.*' (for owner) or 'field 90' (for retention) Actually, with the current implementation, the field in the filter string can be arbitrarily named; the field name is parsed out by the antlr grammar and renamed according to TableQueryFilterType. So if TableQueryFilterType is OWNER, then the following filters are equivalent: owner like \.*test.\, key like \.*test.*\, field like \.*test.*\, etc. bq. On 2011-06-17 00:13:20, Paul Yang wrote: bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java, line 1203 bq. https://reviews.apache.org/r/910/diff/1/?file=21193#file21193line1203 bq. bq. Style issue, { should be on same line as if Will fix. bq. On 2011-06-17 00:13:20, Paul Yang wrote: bq. trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java, lines 189-197 bq. https://reviews.apache.org/r/910/diff/1/?file=21198#file21198line189 bq. bq. JDO-174 looks like it was fixed a while back - is this still an issue? and may be useful operators for the the parameters field. (e.g. if retention were stored there instead of the member field) I agree that the and could be pretty useful operators here. The issue was said to be resolved over 5 years ago, but surprisingly I think it just closed a few days ago https://issues.apache.org/jira/browse/JDO-174?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel#issue-tabs. In any case, comparing the result of a map.get() with anything other than equality throws the same error as the one described in JDO-174. Trying to cast the result of map.get() to a String with ((String) this.parameters.get(keyName) value throws the following seemingly unresolvable error: org.datanucleus.store.exceptions.NoTableManagedException: Persistent class java.lang.String has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class. - Sohan --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/910/#review855 --- On 2011-06-16 03:13:24, Sohan Jain wrote: bq. bq. --- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/910/ bq. --- bq. bq. (Updated 2011-06-16 03:13:24) bq. bq. bq. Review request for hive and Paul Yang. bq. bq. bq. Summary bq. --- bq. bq. 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, retention, or table parameter key/values. The filtering takes place at the JDO level for efficiency/speed. Added a QueryFilterType enum to easily add new filters and separate logic for filtering. bq. bq. Example filter statements include: bq. filterType = QueryFilterType.OWNER; filter = owner like .*test_user.* bq. filterType = QueryFilterType.RETENTION; filter = retention 90 and retention 30 bq. filterType = QueryFilterType.PARAMS; filter = numPartitions = \2\ and
[jira] [Commented] (HIVE-2226) Add API to retrieve table names by an arbitrary filter, e.g., by owner, retention, parameters, etc.
[ https://issues.apache.org/jira/browse/HIVE-2226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13050195#comment-13050195 ] jirapos...@reviews.apache.org commented on HIVE-2226: - --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/910/ --- Review request for hive and Paul Yang. 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, retention, or table parameter key/values. The filtering takes place at the JDO level for efficiency/speed. Added a QueryFilterType enum to easily add new filters and separate logic for filtering. Example filter statements include: filterType = QueryFilterType.OWNER; filter = owner like .*test_user.* filterType = QueryFilterType.RETENTION; filter = retention 90 and retention 30 filterType = QueryFilterType.PARAMS; filter = numPartitions = \2\ and retention_days = \30\ The filter can currently parse string or integer values, where values interpreted as strings must be in quotes. This addresses bug HIVE-2226. https://issues.apache.org/jira/browse/HIVE-2226 Diffs - trunk/metastore/if/hive_metastore.thrift 1135227 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java 1135227 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java 1135227 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java 1135227 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 1135227 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java 1135227 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/ExpressionTree.java 1135227 trunk/metastore/src/java/org/apache/hadoop/hive/metastore/parser/Filter.g 1135227 trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java 1135227 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