You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/11/09 16:44:10 UTC

[GitHub] [hive] deniskuzZ commented on a diff in pull request #3708: HIVE-26580: SHOW COMPACTIONS should support ordering and limiting fun…

deniskuzZ commented on code in PR #3708:
URL: https://github.com/apache/hive/pull/3708#discussion_r1018178679


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/process/show/compactions/ShowCompactionsOperation.java:
##########
@@ -99,20 +99,26 @@ private ShowCompactRequest getShowCompactioRequest(ShowCompactionsDesc desc) thr
     if (isNotEmpty(desc.getPartSpec())) {
       request.setPartitionname(AcidUtils.getPartitionName(desc.getPartSpec()));
     }
-    if(desc.getCompactionId()>0){
+    if(desc.getCompactionId() > 0){
      request.setId(desc.getCompactionId());
     }
+    if (desc.getLimit() > -1) {
+      request.setLimit(desc.getLimit());
+    }
+    if (isNotBlank(desc.getOrderBy())) {
+      request.setOrder(desc.getOrderBy());
+    }
     return request;
   }
 
   private void writeHeader(DataOutputStream os) throws IOException {
     os.writeBytes("CompactionId");
     os.write(Utilities.tabCode);
-    os.writeBytes("Database");
+    os.writeBytes("Dbname");

Review Comment:
   do not change existing headers, some of the clients might have scripts relying on them



##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/process/show/compactions/ShowCompactionsOperation.java:
##########
@@ -99,20 +99,26 @@ private ShowCompactRequest getShowCompactioRequest(ShowCompactionsDesc desc) thr
     if (isNotEmpty(desc.getPartSpec())) {
       request.setPartitionname(AcidUtils.getPartitionName(desc.getPartSpec()));
     }
-    if(desc.getCompactionId()>0){
+    if(desc.getCompactionId() > 0){
      request.setId(desc.getCompactionId());
     }
+    if (desc.getLimit() > -1) {
+      request.setLimit(desc.getLimit());
+    }
+    if (isNotBlank(desc.getOrderBy())) {
+      request.setOrder(desc.getOrderBy());
+    }
     return request;
   }
 
   private void writeHeader(DataOutputStream os) throws IOException {
     os.writeBytes("CompactionId");
     os.write(Utilities.tabCode);
-    os.writeBytes("Database");
+    os.writeBytes("Dbname");

Review Comment:
   do not change the existing headers, some of the clients might have scripts relying on them



-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org