Skip to content
Permalink
Browse files

Fix getting views for Hive 2.3+ metastore

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`.
  • Loading branch information...
findepi committed May 28, 2019
1 parent d85eea4 commit 8e9448db79e1361e3b784656825a69281f0a2e84
@@ -723,7 +723,7 @@ private void revokeRole(String role, String granteeName, PrincipalType granteeTy
.stopOnIllegalExceptions()
.run("getAllViews", stats.getGetAllViews().wrap(() -> {
try (ThriftMetastoreClient client = clientProvider.createMetastoreClient()) {
String filter = HIVE_FILTER_FIELD_PARAMS + PRESTO_VIEW_FLAG + " = \"true\"";
String filter = HIVE_FILTER_FIELD_PARAMS + PRESTO_VIEW_FLAG + " LIKE \"true\"";
return Optional.of(client.getTableNamesByFilter(databaseName, filter));
}
}));

0 comments on commit 8e9448d

Please sign in to comment.
You can’t perform that action at this time.