deniskuzZ commented on code in PR #6943:
URL: https://github.com/apache/hive/pull/6943#discussion_r4467533700
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/GetHelper.java:
##########
@@ -119,7 +121,12 @@ public T run(boolean initTable) throws MetaException,
NoSuchObjectException {
// Note that this will be invoked in 2 cases:
// 1) DirectSQL was disabled to start with;
// 2) DirectSQL threw and was disabled in handleDirectSqlError.
- if (!doUseDirectSql && canUseJdoQuery()) {
+ if (!doUseDirectSql) {
+ if (!canUseJdoQuery()) {
Review Comment:
The silent null came from `canUseJdoQuery()` skipping the JDO call. With
just if (!doUseDirectSql), we’d call `getJdoResult()`, which
DirectSqlOnlyHelper makes final and throwing, so run() fails with a
MetaException either way. Also, DirectSqlOnlyHelper makes `canUseDirectSql()`
final/true, so doUseDirectSql can’t become false for these helpers in the first
place.
If you’d still like to keep it as a defensive check, I’m OK with that, but
please use a static message rather than `describeResult()`: results is still
null at that point, and overrides like getPartitionColsWithStats
(results.size() + " partitions") would NPE and hide the real error.
btw, we already define local var `allowJdo = canUseJdoQuery();`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]