use of io.prestosql.execution.SplitCacheMap in project hetu-core by openlookeng.
the class TestOrcCache method testDropCacheOnMultipleTables.
@Test
public void testDropCacheOnMultipleTables() {
SplitCacheMap splitCacheMap = SplitCacheMap.getInstance();
assertQuerySucceeds("CACHE TABLE test_drop_cache_1 WHERE p1 = 1");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.test_drop_cache_1").showPredicates().contains("(p1 = 1)"));
assertQuerySucceeds("CACHE TABLE test_drop_cache_2 WHERE p3 = 3");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.test_drop_cache_2").showPredicates().contains("(p3 = 3)"));
assertQuerySucceeds("CACHE TABLE test_drop_cache_2 WHERE p3 = 4");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.test_drop_cache_2").showPredicates().contains("(p3 = 4)"));
assertQuerySucceeds("CACHE TABLE test_drop_cache_1 WHERE p2 = 2");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.test_drop_cache_1").showPredicates().contains("(p2 = 2)"));
assertQuerySucceeds("DROP CACHE test_drop_cache_1");
assertEquals(splitCacheMap.tableCacheInfoMap().get("hive.tpch.test_drop_cache_1"), null);
assertQuerySucceeds("DROP CACHE test_drop_cache_2");
assertEquals(splitCacheMap.tableCacheInfoMap().get("hive.tpch.test_drop_cache_2"), null);
}
use of io.prestosql.execution.SplitCacheMap in project hetu-core by openlookeng.
the class TestOrcCache method testDropCacheWithNonExistPredicates.
@Test
public void testDropCacheWithNonExistPredicates() {
SplitCacheMap splitCacheMap = SplitCacheMap.getInstance();
assertUpdate("CREATE TABLE test_drop_cache(id INTEGER, par INTEGER) WITH (partitioned_by = ARRAY['par'], format = 'ORC')");
assertQuerySucceeds("CACHE TABLE test_drop_cache WHERE par = 0");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.test_drop_cache").showPredicates().contains("(par = 0)"));
assertQueryFails("DROP CACHE test_drop_cache WHERE par = 1", ".*?Cache predicate '\\(par = 1\\)' does not exist");
}
use of io.prestosql.execution.SplitCacheMap in project hetu-core by openlookeng.
the class TestOrcCache method testShowCache.
@Test
public void testShowCache() {
SplitCacheMap splitCacheMap = SplitCacheMap.getInstance();
assertQuerySucceeds("CACHE TABLE employee WHERE dob BETWEEN DATE '1980-01-01' AND DATE '2000-01-01'");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(dob BETWEEN DATE '1980-01-01' AND DATE '2000-01-01')"));
assertQuerySucceeds("CACHE TABLE employee WHERE perf > DOUBLE '9.0'");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(dob BETWEEN DATE '1980-01-01' AND DATE '2000-01-01')"));
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(perf > DOUBLE '9.0')"));
}
use of io.prestosql.execution.SplitCacheMap in project hetu-core by openlookeng.
the class TestOrcCache method testCacheTableWithIsNotNullPredicate.
@Test
public void testCacheTableWithIsNotNullPredicate() {
SplitCacheMap splitCacheMap = SplitCacheMap.getInstance();
assertQuerySucceeds("CACHE TABLE employee WHERE dob IS NOT NULL");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(dob IS NOT NULL)"));
assertQuerySucceeds("CACHE TABLE employee WHERE name IS NOT NULL");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(name IS NOT NULL)"));
assertQuerySucceeds("CACHE TABLE employee WHERE perf IS NOT NULL");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(perf IS NOT NULL)"));
}
use of io.prestosql.execution.SplitCacheMap in project hetu-core by openlookeng.
the class TestOrcCache method testCacheTableWithIsNullPredicate.
@Test
public void testCacheTableWithIsNullPredicate() {
SplitCacheMap splitCacheMap = SplitCacheMap.getInstance();
assertQuerySucceeds("CACHE TABLE employee WHERE dob IS NULL");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(dob IS NULL)"));
assertQuerySucceeds("CACHE TABLE employee WHERE name IS NULL");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(name IS NULL)"));
assertQuerySucceeds("CACHE TABLE employee WHERE perf IS NULL");
assertTrue(splitCacheMap.tableCacheInfoMap().get("hive.tpch.employee").showPredicates().contains("(perf IS NULL)"));
}
Aggregations