-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getting views for Hive 2.3+ metastore #833
Fix getting views for Hive 2.3+ metastore #833
Conversation
Nice trick! |
@electrum see https://issues.apache.org/jira/browse/HIVE-12274 ("Increase width of columns used for general configuration in the metastore.") diff, how it touches the tests. argh, but Hive < 2.3 did not support |
8e9448d
to
c5a8354
Compare
Hive 2.3 metastore provides more space for table parameter values. On certain databases (e.g. Derby, Oracle) it uses CLOB and these databases disallow `=` predicates over CLOB values. At the same time, they allow `LIKE` predicates over them. This fixes `SHOW TABLES` and queries over `information_schema.tables`.
c5a8354
to
d5b6f27
Compare
@@ -117,6 +117,9 @@ | |||
private final Duration maxRetryTime; | |||
private final int maxRetries; | |||
|
|||
private volatile boolean metastoreKnownToSupportTableParamEqualsPredicate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe shorten KnownToSupport
to Supports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then i wouldn't be able to use false
as an initial value (because initially i don't know yet).
return views; | ||
} | ||
catch (TException | RuntimeException secondException) { | ||
if (firstException != secondException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would firstException == secondException
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically you can keep an exception and rethrow it multiple times. I see no particular reason why this could happen here.
Apparently we often guard calls to java.lang.Throwable#addSuppressed
like this (for apparently no particular reason), so I am blindly following an established convention 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems unlikely to happen in practice but is a good safety measure.
On certain databases (e.g. Derby, Oracle) it uses CLOB and these databases disallow `=` predicates over CLOB values. At the same time, they allow `LIKE` predicates over them. cherry-picked : trinodb/trino#833
Hive 2.3 metastore provides more space for table parameter values. On
certain databases (e.g. Derby, Oracle) it uses CLOB and these databases
disallow
=
predicates over CLOB values. At the same time, they allowLIKE
predicates over them.This fixes
SHOW TABLES
and queries overinformation_schema.tables
.Also, fixes prestodb/presto#10735, nico-arianto/big-data-local#1.