You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "wecharyu (via GitHub)" <gi...@apache.org> on 2024/02/28 06:49:31 UTC

[PR] HIVE-28096: Fix the mismatched function names in HMSHandler audit log [hive]

wecharyu opened a new pull request, #5104:
URL: https://github.com/apache/hive/pull/5104

   ### What changes were proposed in this pull request?
   Normalize the `startFunction()` and `endFunction()` calls in `HMSHandler`:
   1. Fix the mismatched function name.
   2. Add the missed `startFunction()` or endFunction() calls.
   3. Unify the function name, remove the `.(dot)` or additional suffix empty chars in some function names.
   
   ### Why are the changes needed?
   The mismatched function names would cause the counter and api cost metrics wrong.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### Is the change a dependency upgrade?
   No.
   
   ### How was this patch tested?
   Deploy and test the metrics.
   


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


Re: [PR] HIVE-28096: Fix the mismatched function names in HMSHandler audit log [hive]

Posted by "wecharyu (via GitHub)" <gi...@apache.org>.
wecharyu commented on code in PR #5104:
URL: https://github.com/apache/hive/pull/5104#discussion_r1509948957


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -4392,19 +4392,17 @@ private List<Partition> createPartitionFolders(final List<Partition> partitionsT
   @Override
   public AddPartitionsResult add_partitions_req(AddPartitionsRequest request)
       throws TException {
-    startFunction("add_partitions_req",
-        ": db=" + request.getDbName() + " tab=" + request.getTblName());
-    AddPartitionsResult result = new AddPartitionsResult();
-    if (request.getParts().isEmpty()) {
-      return result;
-    }
     String catName = request.isSetCatName() ? request.getCatName() : getDefaultCatalog(conf);
     String dbName = request.getDbName();
     String tblName = request.getTblName();
     startTableFunction("add_partitions_req", catName, dbName, tblName);
 
+    AddPartitionsResult result = new AddPartitionsResult();
     Exception ex = null;
     try {
+      if (request.getParts().isEmpty()) {
+        return result;

Review Comment:
   If we do not move this code into try clause, the `endFunction()` calls would be missed.



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


Re: [PR] HIVE-28096: Fix the mismatched function names in HMSHandler audit log [hive]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #5104: HIVE-28096: Fix the mismatched function names in HMSHandler audit log
URL: https://github.com/apache/hive/pull/5104


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


Re: [PR] HIVE-28096: Fix the mismatched function names in HMSHandler audit log [hive]

Posted by "zratkai (via GitHub)" <gi...@apache.org>.
zratkai commented on code in PR #5104:
URL: https://github.com/apache/hive/pull/5104#discussion_r1508778012


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -1058,7 +1058,7 @@ public GetCatalogsResponse get_catalogs() throws MetaException {
       ex = e;
       throw e;
     } finally {
-      endFunction("get_catalog", ret != null, ex);
+      endFunction("get_catalogs", ret != null, ex);

Review Comment:
   This should be "alter_catalog" .



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


Re: [PR] HIVE-28096: Fix the mismatched function names in HMSHandler audit log [hive]

Posted by "zratkai (via GitHub)" <gi...@apache.org>.
zratkai commented on code in PR #5104:
URL: https://github.com/apache/hive/pull/5104#discussion_r1508780131


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -4392,19 +4392,17 @@ private List<Partition> createPartitionFolders(final List<Partition> partitionsT
   @Override
   public AddPartitionsResult add_partitions_req(AddPartitionsRequest request)
       throws TException {
-    startFunction("add_partitions_req",
-        ": db=" + request.getDbName() + " tab=" + request.getTblName());
-    AddPartitionsResult result = new AddPartitionsResult();
-    if (request.getParts().isEmpty()) {
-      return result;
-    }
     String catName = request.isSetCatName() ? request.getCatName() : getDefaultCatalog(conf);
     String dbName = request.getDbName();
     String tblName = request.getTblName();
     startTableFunction("add_partitions_req", catName, dbName, tblName);
 
+    AddPartitionsResult result = new AddPartitionsResult();
     Exception ex = null;
     try {
+      if (request.getParts().isEmpty()) {
+        return result;

Review Comment:
   This is not covered in the topic of thic PR: " Fix the mismatched function names".
   Why do we need this here?



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


Re: [PR] HIVE-28096: Fix the mismatched function names in HMSHandler audit log [hive]

Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #5104:
URL: https://github.com/apache/hive/pull/5104#issuecomment-1968416769

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5104) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [8 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5104&resolved=false&inNewCodePeriod=true)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5104&resolved=false&inNewCodePeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/no-data-16px.png '') No data about Coverage  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/no-data-16px.png '') No data about Duplication  
     
   [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5104)
   
   


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


Re: [PR] HIVE-28096: Fix the mismatched function names in HMSHandler audit log [hive]

Posted by "zratkai (via GitHub)" <gi...@apache.org>.
zratkai commented on code in PR #5104:
URL: https://github.com/apache/hive/pull/5104#discussion_r1508778012


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -1058,7 +1058,7 @@ public GetCatalogsResponse get_catalogs() throws MetaException {
       ex = e;
       throw e;
     } finally {
-      endFunction("get_catalog", ret != null, ex);
+      endFunction("get_catalogs", ret != null, ex);

Review Comment:
   This should be "alter_catalog" .



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


Re: [PR] HIVE-28096: Fix the mismatched function names in HMSHandler audit log [hive]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5104:
URL: https://github.com/apache/hive/pull/5104#issuecomment-2089327811

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


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