deniskuzZ commented on code in PR #6379:
URL: https://github.com/apache/hive/pull/6379#discussion_r3362177979
##########
ql/src/java/org/apache/hadoop/hive/llap/ProactiveEviction.java:
##########
@@ -233,19 +224,28 @@ public
List<LlapDaemonProtocolProtos.EvictEntityRequestProto> toProtoRequests()
* @return true if cacheTag matches and the related buffer is eligible for
proactive eviction, false otherwise.
*/
public boolean isTagMatch(CacheTag cacheTag) {
- String db = getSingleDbName();
+ String[] names = cacheTag.getTableName().split("\\.");
+ String catalog = Warehouse.DEFAULT_CATALOG_NAME;
+ String db = null;
+ if (names.length == 2) {
+ db = names[0];
+ } else if (names.length == 3) {
+ catalog = names[0];
+ db = names[1];
+ }
if (db == null) {
- // Number of DBs in the request was not exactly 1.
- throw new UnsupportedOperationException("Predicate only implemented
for 1 DB case.");
+ // Number of (catalog, DB) pairs in the request was not exactly 1.
+ throw new UnsupportedOperationException("Predicate only implemented
for 1 catalog and 1 DB case.");
Review Comment:
please add test
````
@Test
public void testNonConformingTagsAreIgnoredAndDoNotThrow() {
Request request = Builder.create().addDb("ice01").build();
assertFalse(request.isTagMatch(CacheTag.build("hive.db1.ice01.snapshots"))); //
4-part metadata table
assertFalse(request.isTagMatch(CacheTag.build("hive.ice01")));
// 2-part sentinel
assertFalse(request.isTagMatch(CacheTag.build("ice01")));
// 1-part fallback
}
````
--
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]