You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "rtrivedi12 (via GitHub)" <gi...@apache.org> on 2025/04/11 21:38:25 UTC
[PR] HIVE-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
rtrivedi12 opened a new pull request, #5766:
URL: https://github.com/apache/hive/pull/5766
…ange in partition location
### What changes were proposed in this pull request?
This change skips the DFS_URI authorization if there is no change in the PARTITION location in the ALTER_PARTITION event.
If the old partition and new partition Uri are the same or the old partition location is empty, then skip adding DFS_URI for authorization.
### Why are the changes needed?
The LOAD DATA command invokes the ALTER_PARTITION event to update stats for the newly loaded partition. ALTER_PARTITION authorizes DFS_URI for the partition location even when the partition locations do not change. This requires the Hadoop SQL policy for DFS_URI to be defined for the partition location for LOAD DATA commands.
### Does this PR introduce _any_ user-facing change?
Yes, after this change, users will no longer need the DFS_URI policy for target table partition location.
### Is the change a dependency upgrade?
No
### How was this patch tested?
Manual testing
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3003489646
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2057336786
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterPartitionEvent.java:
##########
@@ -76,10 +76,15 @@ private List<HivePrivilegeObject> getOutputHObjs() {
ret.add(getHivePrivilegeObject(event.getTable()));
Partition newPartition = event.getNewPartition();
+ Partition oldPartition = event.getOldPart();
Review Comment:
how get the `oldPartition` by
``` Partition oldPartition = Hive.get().getPartition(event.getTable(), Warehouse.makeSpecFromValues(event.getTable().getPartitionKeys(), event.getOldPartVals()));```
this can avoid the modification on `PreAlterPartitionEvent` and `HMSHandler`
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3043520781
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3044527698
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3048979227
The `split-15` is failing constantly, could we check it please? I will close the PR and retry the test pipeline
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "wecharyu (via GitHub)" <gi...@apache.org>.
wecharyu commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2054503160
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterPartitionEvent.java:
##########
@@ -76,10 +76,15 @@ private List<HivePrivilegeObject> getOutputHObjs() {
ret.add(getHivePrivilegeObject(event.getTable()));
Partition newPartition = event.getNewPartition();
+ Partition oldPartition = event.getOldPart();
+
String newUri = (newPartition != null) ? getSdLocation(newPartition.getSd()) : "";
+ String oldUri = (oldPartition != null) ? getSdLocation(oldPartition.getSd()) : "";
- if (StringUtils.isNotEmpty(newUri)) {
- ret.add(getHivePrivilegeObjectDfsUri(newUri));
+ // Skip DFS_URI auth if old and new partition uri are empty or same
+ if (StringUtils.isNotEmpty(newUri) && StringUtils.isNotEmpty(oldUri) && !StringUtils.equalsIgnoreCase(oldUri,
Review Comment:
Do we need `DFS_URI` auth when `newUri` is not empty but `oldUri` is empty? Also consider add unit test for this change.
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2057340281
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterPartitionEvent.java:
##########
@@ -76,10 +76,15 @@ private List<HivePrivilegeObject> getOutputHObjs() {
ret.add(getHivePrivilegeObject(event.getTable()));
Partition newPartition = event.getNewPartition();
+ Partition oldPartition = event.getOldPart();
+
String newUri = (newPartition != null) ? getSdLocation(newPartition.getSd()) : "";
+ String oldUri = (oldPartition != null) ? getSdLocation(oldPartition.getSd()) : "";
- if (StringUtils.isNotEmpty(newUri)) {
- ret.add(getHivePrivilegeObjectDfsUri(newUri));
+ // Skip DFS_URI auth if old and new partition uri are empty or same
+ if (StringUtils.isNotEmpty(newUri) && StringUtils.isNotEmpty(oldUri) && !StringUtils.equalsIgnoreCase(oldUri,
Review Comment:
change the condition to `StringUtils.isNotEmpty(newUri) & !StringUtils.equalsIgnoreCase(oldUri, newUri)` ?
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3006364359
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3048125175
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "rtrivedi12 (via GitHub)" <gi...@apache.org>.
rtrivedi12 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2167719555
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterPartitionEvent.java:
##########
@@ -76,10 +76,15 @@ private List<HivePrivilegeObject> getOutputHObjs() {
ret.add(getHivePrivilegeObject(event.getTable()));
Partition newPartition = event.getNewPartition();
+ Partition oldPartition = event.getOldPart();
+
String newUri = (newPartition != null) ? getSdLocation(newPartition.getSd()) : "";
+ String oldUri = (oldPartition != null) ? getSdLocation(oldPartition.getSd()) : "";
- if (StringUtils.isNotEmpty(newUri)) {
- ret.add(getHivePrivilegeObjectDfsUri(newUri));
+ // Skip DFS_URI auth if old and new partition uri are empty or same
+ if (StringUtils.isNotEmpty(newUri) && StringUtils.isNotEmpty(oldUri) && !StringUtils.equalsIgnoreCase(oldUri,
Review Comment:
@wecharyu I have updated the condition to `StringUtils.isNotEmpty(newUri) & !StringUtils.equalsIgnoreCase(oldUri, newUri)` now. And this patch proposes skipping DFS_URI authorization if there is no change in partition location. So, if new URI is non-empty and old uri is empty , ALTER PARTITION might be triggered for other HiveOperationType like ALTERPARTITION_FILEFORMAT, ALTERPARTITION_SERDEPROPERTIES which does not require DFS_URI auth.
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3053964360
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-2998378678
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
Re: [PR] HIVE-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2167943712
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterPartitionEvent.java:
##########
@@ -76,10 +79,17 @@ private List<HivePrivilegeObject> getOutputHObjs() {
ret.add(getHivePrivilegeObject(event.getTable()));
Partition newPartition = event.getNewPartition();
- String newUri = (newPartition != null) ? getSdLocation(newPartition.getSd()) : "";
+ String oldUri = "";
- if (StringUtils.isNotEmpty(newUri)) {
- ret.add(getHivePrivilegeObjectDfsUri(newUri));
+ if (event.getOldPartVals() != null && event.getOldPartVals().size() > 0) {
Review Comment:
should change `null` to `tmpPart.getValues` in this line: https://github.com/apache/hive/blob/master/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java#L6184?
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3059271211
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "saihemanth-cloudera (via GitHub)" <gi...@apache.org>.
saihemanth-cloudera commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2044812076
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -6051,8 +6051,9 @@ private void alter_partition_core(String catName, String db_name, String tbl_nam
Exception ex = null;
try {
Table table = getMS().getTable(catName, db_name, tbl_name, null);
+ Partition oldPartition = getMS().getPartition(catName, db_name, tbl_name, part_vals);
Review Comment:
nit: we fetch oldPart at L6062, can you see if you can eliminate this redundant call?
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3046517231
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3047001023
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3049485469
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3050567658
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "rtrivedi12 (via GitHub)" <gi...@apache.org>.
rtrivedi12 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2163974228
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterPartitionEvent.java:
##########
@@ -76,10 +76,15 @@ private List<HivePrivilegeObject> getOutputHObjs() {
ret.add(getHivePrivilegeObject(event.getTable()));
Partition newPartition = event.getNewPartition();
+ Partition oldPartition = event.getOldPart();
Review Comment:
@deniskuzZ Both Partition and Table objects in `PreAlterPartitionEvent` are thrift table and thrift partition and would need to be translated to org.apache.hadoop.hive.ql.metadata.Table and org.apache.hadoop.hive.ql.metadata.Partition. But I think this makes sense to avoid modification in PreAlterPartitionEvent and HMSHandler.
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-3047336408
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [14 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 closed pull request #5766: HIVE-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch…
URL: https://github.com/apache/hive/pull/5766
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "rtrivedi12 (via GitHub)" <gi...@apache.org>.
rtrivedi12 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2167190584
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -6051,8 +6051,9 @@ private void alter_partition_core(String catName, String db_name, String tbl_nam
Exception ex = null;
try {
Table table = getMS().getTable(catName, db_name, tbl_name, null);
+ Partition oldPartition = getMS().getPartition(catName, db_name, tbl_name, part_vals);
Review Comment:
I removed this redundant call from `HMSHandler`.
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5766:
URL: https://github.com/apache/hive/pull/5766#issuecomment-2798294828
## [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766) **Quality Gate passed**
Issues
 [9 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5766&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5766&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5766&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5766)
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "rtrivedi12 (via GitHub)" <gi...@apache.org>.
rtrivedi12 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2163981065
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterPartitionEvent.java:
##########
@@ -76,10 +76,15 @@ private List<HivePrivilegeObject> getOutputHObjs() {
ret.add(getHivePrivilegeObject(event.getTable()));
Partition newPartition = event.getNewPartition();
+ Partition oldPartition = event.getOldPart();
+
String newUri = (newPartition != null) ? getSdLocation(newPartition.getSd()) : "";
+ String oldUri = (oldPartition != null) ? getSdLocation(oldPartition.getSd()) : "";
- if (StringUtils.isNotEmpty(newUri)) {
- ret.add(getHivePrivilegeObjectDfsUri(newUri));
+ // Skip DFS_URI auth if old and new partition uri are empty or same
+ if (StringUtils.isNotEmpty(newUri) && StringUtils.isNotEmpty(oldUri) && !StringUtils.equalsIgnoreCase(oldUri,
Review Comment:
@wecharyu @dengzhhu653 We want to skip DFS_URI auth when newUri is not empty but oldUri is empty like in case of stats update during LOAD PARTITION, it would have empty old uri and non-empty new URI.
But I see your point this condition would be anyways covered by `!StringUtils.equalsIgnoreCase(oldUri, newUri)`.
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "wecharyu (via GitHub)" <gi...@apache.org>.
wecharyu commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2164371907
##########
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/events/AlterPartitionEvent.java:
##########
@@ -76,10 +76,15 @@ private List<HivePrivilegeObject> getOutputHObjs() {
ret.add(getHivePrivilegeObject(event.getTable()));
Partition newPartition = event.getNewPartition();
+ Partition oldPartition = event.getOldPart();
+
String newUri = (newPartition != null) ? getSdLocation(newPartition.getSd()) : "";
+ String oldUri = (oldPartition != null) ? getSdLocation(oldPartition.getSd()) : "";
- if (StringUtils.isNotEmpty(newUri)) {
- ret.add(getHivePrivilegeObjectDfsUri(newUri));
+ // Skip DFS_URI auth if old and new partition uri are empty or same
+ if (StringUtils.isNotEmpty(newUri) && StringUtils.isNotEmpty(oldUri) && !StringUtils.equalsIgnoreCase(oldUri,
Review Comment:
Not quite understand why not need check the newUri auth when oldUri is empty but newUri is not.
> But I see your point this condition would be anyways covered by !StringUtils.equalsIgnoreCase(oldUri, newUri).
But the check would fail-fast by `StringUtils.isNotEmpty(oldUri)` in your current implementation.
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 merged PR #5766:
URL: https://github.com/apache/hive/pull/5766
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2167945304
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/events/PreAlterPartitionEvent.java:
##########
@@ -18,14 +18,14 @@
package org.apache.hadoop.hive.metastore.events;
-import java.util.List;
Review Comment:
nit: please revert the change if possible
--
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-28848:Remove DFS_URI auth from ALTER_PARTITION if there is no ch… [hive]
Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on code in PR #5766:
URL: https://github.com/apache/hive/pull/5766#discussion_r2167944893
##########
ql/src/test/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/TestHiveMetaStoreAuthorizer.java:
##########
@@ -696,6 +700,107 @@ public void testU_DropDataConnector_authorizedUser() {
}
}
+
+ /**
+ * Captures and returns the privilege objects for Alter Partition
+ */
+ private Pair<List<HivePrivilegeObject>, List<HivePrivilegeObject>> getHivePrivilegeObjectsForAlterPartition()
+ throws HiveAuthzPluginException, HiveAccessControlException {
+ @SuppressWarnings("unchecked")
+ Class<List<HivePrivilegeObject>> class_listPrivObjects = (Class) List.class;
+ ArgumentCaptor<List<HivePrivilegeObject>> inputsCapturer = ArgumentCaptor
+ .forClass(class_listPrivObjects);
+ ArgumentCaptor<List<HivePrivilegeObject>> outputsCapturer = ArgumentCaptor
+ .forClass(class_listPrivObjects);
+
+ verify(mockHiveAuthorizer).checkPrivileges(eq(HiveOperationType.ALTERPARTITION_FILEFORMAT),
+ inputsCapturer.capture(), outputsCapturer.capture(),
+ any(HiveAuthzContext.class));
+
+ return new ImmutablePair<>(inputsCapturer.getValue(), outputsCapturer.getValue());
+ }
+ @Test
+ public void testV_AlterPartition_DFSUriPrivObject() {
+ UserGroupInformation.setLoginUser(UserGroupInformation.createRemoteUser(authorizedUser));
+ try {
+ List<List<String>> testValues = createTable4PartColsParts();
+ List<Partition> oldParts = hmsHandler.get_partitions(dbName, tblName, (short) -1);
+ Partition oldPart = oldParts.get(3);
+ Partition newPart = makeTestChangesOnPartition(oldPart);
+
+ hmsHandler.rename_partition(dbName, tblName,oldPart.getValues(),newPart);
+
+ Pair<List<HivePrivilegeObject>, List<HivePrivilegeObject>> io = getHivePrivilegeObjectsForAlterPartition();
+ List<HivePrivilegeObject> outputs = io.getRight();
+
+ List<HivePrivilegeObject> tableOutputs = outputs.stream()
+ .filter(o -> o.getType() == HivePrivilegeObject.HivePrivilegeObjectType.DFS_URI)
+ .collect(Collectors.toList());
+
+ assertEquals("Should have one DFS_URI privilege object", 1, tableOutputs.size());
+ HivePrivilegeObject DFSUriObj = tableOutputs.get(0);
+
+ assertEquals("Output object should be a table",
+ HivePrivilegeObject.HivePrivilegeObjectType.DFS_URI,
+ DFSUriObj.getType());
Review Comment:
this should always be a `DFS_URI` obj, can we validate the real location instead?
--
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