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 2023/11/28 09:12:59 UTC
[PR] HIVE-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
wecharyu opened a new pull request, #4904:
URL: https://github.com/apache/hive/pull/4904
…pDatabase and Hive.dropConnector
### What changes were proposed in this pull request?
Wrap `NoSuchObjectException` into `HiveException` for dropDatabase and dropDataConnector api in `Hive`.
### Why are the changes needed?
To align the `drop_database` and `drop_dataconnector` behavior with `drop_table`.
### Does this PR introduce _any_ user-facing change?
Yes, the Hive client user need handle the `NoSuchObjectException` inside `HiveException` after this change.
### Is the change a dependency upgrade?
No
### How was this patch tested?
Pass existing tests.
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on PR #4904:
URL: https://github.com/apache/hive/pull/4904#issuecomment-1830138365
if i have a call like
try {
do something
} catch(NoSuchObjectException ne) {
do some logic
}
now if I throw HiveException, such a code will break, right?
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "wecharyu (via GitHub)" <gi...@apache.org>.
wecharyu commented on PR #4904:
URL: https://github.com/apache/hive/pull/4904#issuecomment-1830170102
> now if I throw HiveException, such a code will break, right?
Yes, it will break for dropDatabase api.
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "wecharyu (via GitHub)" <gi...@apache.org>.
wecharyu commented on PR #4904:
URL: https://github.com/apache/hive/pull/4904#issuecomment-1837942160
Close it since there are some incompatible cases.
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "wecharyu (via GitHub)" <gi...@apache.org>.
wecharyu closed pull request #4904: HIVE-27913: Wrap NoSuchObjectException into HiveException in Hive.dro…
URL: https://github.com/apache/hive/pull/4904
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "aturoczy (via GitHub)" <gi...@apache.org>.
aturoczy commented on PR #4904:
URL: https://github.com/apache/hive/pull/4904#issuecomment-1829591812
> > Does this PR introduce any user-facing change?
> > Yes, the Hive client user need handle the NoSuchObjectException inside HiveException after this change.
>
> And why we would do that & introduce incompatibilities for the end client?
Maybe it is not even incompatible. I try to find out which actor is throwing the NoSuchObjectException and I haven't found it. What was the purpose of this exception? The Object does not exist anymore?
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on PR #4904:
URL: https://github.com/apache/hive/pull/4904#issuecomment-1835461518
> Yes, it will break for dropDatabase api.
then this isn't happening, sorry
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #4904:
URL: https://github.com/apache/hive/pull/4904#issuecomment-1829544460
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=4904)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4904&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4904&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4904&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=CODE_SMELL) [12 Code Smells](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4904&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4904&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4904&metric=duplicated_lines_density&view=list) No Duplication information
 The version of Java (11.0.8) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more [here](https://docs.sonarsource.com/sonarcloud/appendices/scanner-environment/)
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "aturoczy (via GitHub)" <gi...@apache.org>.
aturoczy commented on PR #4904:
URL: https://github.com/apache/hive/pull/4904#issuecomment-1830170710
> NoSuchObjectException
This is a dilemma to me. Actually, the NoSuchObjectException does not describe the nature of the exception. It is pretty undescribed, what kind of object. Table, Column, Database etc. An object is missing, but an object could be anything. Which imho is not clear for the API user.
On the other hand, the HiveException is too general in the Hive. It wraps everything and does not describe the actual issue till you do not open the details of the exception. Which is also not the best design principals.
Of course, it would need a wider agreement. But to me, it will be the following
HiveExcption is the root and I would have DatabaseMissingException, TableMissingException, and more detailed exception for those scenarios where the API consumers would read it clearly.
cc: @deniskuzZ @ayushtkn @abstractdog
--
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-27913: Wrap NoSuchObjectException into HiveException in Hive.dro… [hive]
Posted by "wecharyu (via GitHub)" <gi...@apache.org>.
wecharyu commented on PR #4904:
URL: https://github.com/apache/hive/pull/4904#issuecomment-1830047257
`dropDatabase` may encounter `NoSuchObjectException` if the database does not exist:
https://github.com/apache/hive/blob/6b2e21a93ef3c1776b689a7953fc59dbf52e4be4/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java#L1675-L1684
`dropDataConnector` is compatible because it already wrap the exception in master:
https://github.com/apache/hive/blob/6b2e21a93ef3c1776b689a7953fc59dbf52e4be4/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java#L992-L999
The reason to add this change is that most exceptions in `Hive.java` are wrapped into `HiveException`, such as `dropTable`. And when using Hive call we do not need catch extra exceptions except for HiveException. Also this change will not affect the user result because NoSuchObjectException will be caught in HiveException.
CC: @ayushtkn @aturoczy
--
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