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

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

                Author: ASF GitHub Bot
            Created on: 11/Oct/22 09:59
            Start Date: 11/Oct/22 09:59
    Worklog Time Spent: 10m 
      Work Description: rkirtir commented on code in PR #3608:
URL: https://github.com/apache/hive/pull/3608#discussion_r992110946


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -3970,6 +3960,78 @@ public ShowCompactResponse 
showCompact(ShowCompactRequest rqst) throws MetaExcep
     }
   }
 
+  private List<String> getShowCompactionQueryParamList(ShowCompactRequest 
request) throws MetaException {
+    String dbName = request.getDbname();
+    String tableName = request.getTablename();
+    String partName = request.getPartitionname();
+    CompactionType type = request.getType();
+    String state = request.getState();
+    String poolName = request.getPoolName();
+    List<String> params = new ArrayList<>();
+    if (dbName != null && !dbName.isEmpty()) {
+      params.add(dbName);
+    }
+    if (tableName != null && !tableName.isEmpty()) {

Review Comment:
   resolved



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -3970,6 +3960,78 @@ public ShowCompactResponse 
showCompact(ShowCompactRequest rqst) throws MetaExcep
     }
   }
 
+  private List<String> getShowCompactionQueryParamList(ShowCompactRequest 
request) throws MetaException {
+    String dbName = request.getDbname();
+    String tableName = request.getTablename();
+    String partName = request.getPartitionname();
+    CompactionType type = request.getType();
+    String state = request.getState();
+    String poolName = request.getPoolName();
+    List<String> params = new ArrayList<>();
+    if (dbName != null && !dbName.isEmpty()) {
+      params.add(dbName);
+    }
+    if (tableName != null && !tableName.isEmpty()) {
+      params.add(tableName);
+    }
+    if (partName != null && !partName.isEmpty()) {
+      params.add(partName);
+    }
+    if (state != null && !state.isEmpty()) {
+      params.add(state);
+    }
+    if (type != null) {
+      params.add(thriftCompactionType2DbType(type).toString());
+    }
+    if (org.apache.commons.lang3.StringUtils.isNotBlank(poolName)) {
+      params.add(poolName);
+    }
+    return params;
+  }
+
+  private String getFilterClause(ShowCompactRequest request) {
+    StringBuilder filter = new StringBuilder();
+    String dbName = request.getDbname();
+    String tableName = request.getTablename();
+    String partName = request.getPartitionname();
+    CompactionType type = request.getType();
+    String state = request.getState();
+    String poolName = request.getPoolName();
+    if (dbName != null && !dbName.isEmpty()) {

Review Comment:
   resolved





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

    Worklog Id:     (was: 815593)
    Time Spent: 3.5h  (was: 3h 20m)

> SHOW COMPACTIONS should support filtering options
> -------------------------------------------------
>
>                 Key: HIVE-13353
>                 URL: https://issues.apache.org/jira/browse/HIVE-13353
>             Project: Hive
>          Issue Type: Improvement
>          Components: Transactions
>    Affects Versions: 1.3.0, 2.0.0
>            Reporter: Eugene Koifman
>            Assignee: KIRTI RUGE
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-13353.01.patch
>
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> Since we now have historical information in SHOW COMPACTIONS the output can 
> easily become unwieldy. (e.g. 1000 partitions with 3 lines of history each)
> this is a significant usability issue
> Need to add ability to filter by db/table/partition
> Perhaps would also be useful to filter by status



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to