Skip to content
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

Allow disabling caching missing tables in CachingMetastore #17177

Conversation

findepi
Copy link
Member

@findepi findepi commented Apr 21, 2023

Table absence is harder to less interesting to cache and sometimes undesirable at all. This is similar to metadata.cache-missing config we have for JDBC connectors.

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Apr 21, 2023
@cla-bot cla-bot bot added the cla-signed label Apr 21, 2023
@findepi findepi force-pushed the findepi/allow-disabling-caching-missing-tables-in-cachingmetastore-6c57b6 branch from 72a207d to 0101fee Compare April 21, 2023 18:19
@github-actions github-actions bot added hive Hive connector tests:hive labels Apr 21, 2023
return value;
}
cache.invalidate(key);
}
return cache.getUnchecked(key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary call this method if the value is not present?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, cache.getIfPresent didn't load anything yet

Copy link
Member

@sopel39 sopel39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -141,6 +141,7 @@ public void setUp()
.cacheTtl(new Duration(5, TimeUnit.MINUTES))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add dedicated test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -943,7 +982,7 @@ public Optional<List<String>> getPartitionNamesByFilter(
List<String> columnNames,
TupleDomain<String> partitionKeysFilter)
{
return get(partitionFilterCache, partitionFilter(databaseName, tableName, columnNames, partitionKeysFilter));
return getOptional(partitionFilterCache, partitionFilter(databaseName, tableName, columnNames, partitionKeysFilter));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be also used in bulk loaded cache?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps, but I didn't find the bulk loaded cache which caches absence, can you help me with that?

findepi added 3 commits April 24, 2023 14:40
Make it clear that `TestCachingHiveMetastore`'s `metastore` and
`statsCacheMetastore` differ with `metadataCacheEnabled` and
`statsCacheEnabled` -- make it apparent by the later's name and in their
initialization.
Table absence is harder to less interesting to cache and sometimes
undesirable at all. This is similar to `metadata.cache-missing` config
we have for JDBC connectors.
Enforce the caller provides configuration, so that
`CachingHiveMetastoreConfig` is the only source of default
configuration.
@findepi findepi force-pushed the findepi/allow-disabling-caching-missing-tables-in-cachingmetastore-6c57b6 branch from 0101fee to 60776c0 Compare April 24, 2023 12:50
@findepi findepi merged commit f18f0d4 into trinodb:master Apr 25, 2023
@findepi findepi deleted the findepi/allow-disabling-caching-missing-tables-in-cachingmetastore-6c57b6 branch April 25, 2023 07:31
@github-actions github-actions bot added this to the 415 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector no-release-notes This pull request does not require release notes entry
Development

Successfully merging this pull request may close these issues.

4 participants