Fix Adding Cluster Name for Refresh Meta Cache

This commit is contained in:
SURYA SUMANTH N 2021-06-24 17:00:00 +05:30
parent c0e5cab002
commit 514fea339b
3 changed files with 9 additions and 2 deletions

View File

@ -6532,4 +6532,11 @@ public class TestHiveIntegrationSmokeTest
assertEquals(sortResult.getMaterializedRows(), hashResult.getMaterializedRows());
assertUpdate("DROP TABLE lineitem_orderkey_partkey_Distinct");
}
@Test
public void testFailRefreshMetaCache()
{
assertQueryFails("REFRESH META CACHE FOR abc", "Catalog does not exist:abc");
assertQueryFails("REFRESH META CACHE FOR abc.def", "Catalog does not exist:abc.def");
}
}

View File

@ -150,7 +150,7 @@ statement
| SET PATH pathSpecification #setPath
| VACUUM TABLE qualifiedName (FULL (UNIFY)?)? (PARTITION partition=string)?
(AND_WAIT)? #vacuumTable
| REFRESH META CACHE (FOR (catalog=identifier))? #refreshMetadataCache
| REFRESH META CACHE (FOR (cluster=identifier '.')? catalog=identifier)? #refreshMetadataCache
;
assignmentList

View File

@ -488,7 +488,7 @@ class AstBuilder
@Override
public Node visitRefreshMetadataCache(SqlBaseParser.RefreshMetadataCacheContext context)
{
Optional<Identifier> identifier = createIdentifier(null, context.catalog);
Optional<Identifier> identifier = createIdentifier(context.cluster, context.catalog);
return new RefreshMetadataCache(getLocation(context), identifier);
}