You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some questions about the getTableMeta method in the ThriftHiveMetastoreClient class in Trino's version 453. The problem arises when the databaseName contains wildcard characters (* or |).
According to the current implementation:
if (databaseName.indexOf('*') >= 0 || databaseName.indexOf('|') >= 0) {
// in this case we replace any pipes with a glob and then filter the outputreturnclient.getTableMeta(prependCatalogToDbName(catalogName, databaseName.replace('|', '*')), "*", ImmutableList.of()).stream()
.filter(tableMeta -> tableMeta.getDbName().equals(databaseName))
.collect(toImmutableList());
}
It applies a filter on the result stream that checks for exact matches of tableMeta.getDbName() against the original databaseName, which includes wildcards. This would definitely lead to an empty list being returned because no database name can exactly match a pattern containing wildcards.
For example, assuming there are four schemas in Hive: a1, a2, b1, b2, if we execute:
SELECT*FROMhive.information_schema.tables WHERE table_schema IN ('a*|b*');
And the execution enters the aforementioned logic, it will return an empty list. However, if we directly pass the dbpattern into getTableMeta without the extra filtering, it returns the correct results.
Is this normal implementation logic or is there any extra purpose?
The text was updated successfully, but these errors were encountered:
I have some questions about the getTableMeta method in the ThriftHiveMetastoreClient class in Trino's version 453. The problem arises when the databaseName contains wildcard characters (* or |).
According to the current implementation:
It applies a filter on the result stream that checks for exact matches of tableMeta.getDbName() against the original databaseName, which includes wildcards. This would definitely lead to an empty list being returned because no database name can exactly match a pattern containing wildcards.
For example, assuming there are four schemas in Hive: a1, a2, b1, b2, if we execute:
And the execution enters the aforementioned logic, it will return an empty list. However, if we directly pass the dbpattern into getTableMeta without the extra filtering, it returns the correct results.
Is this normal implementation logic or is there any extra purpose?
The text was updated successfully, but these errors were encountered: