diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java b/fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java index 00c197b27da305..c88f3bd13a127c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/cache/CacheAnalyzer.java @@ -142,12 +142,8 @@ private void checkCacheConfig() { enableSqlCache = true; } } + // alread remove the entrance of partition cache, so we force set to false enablePartitionCache = false; - // if (Config.cache_enable_partition_mode) { - // if (context.getSessionVariable().isEnablePartitionCache()) { - // enablePartitionCache = true; - // } - // } } public TUniqueId getQueryId() { @@ -207,8 +203,6 @@ public boolean enablePartitionCache() { } public static boolean canUseCache(SessionVariable sessionVariable) { - // return (sessionVariable.isEnableSqlCache() || sessionVariable.isEnablePartitionCache()) - // && commonCacheCondition(sessionVariable); return (sessionVariable.isEnableSqlCache()) && commonCacheCondition(sessionVariable); } diff --git a/fe/fe-core/src/test/java/org/apache/doris/qe/HmsQueryCacheTest.java b/fe/fe-core/src/test/java/org/apache/doris/qe/HmsQueryCacheTest.java index e1d5d3f1d9865f..0414b5d148949b 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/qe/HmsQueryCacheTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/qe/HmsQueryCacheTest.java @@ -82,7 +82,6 @@ protected void runBeforeAll() throws Exception { FeConstants.runningUnitTest = true; Config.enable_query_hive_views = true; Config.cache_enable_sql_mode = true; - // Config.cache_enable_partition_mode = true; connectContext.getSessionVariable().setEnableSqlCache(true); env = Env.getCurrentEnv(); diff --git a/fe/fe-core/src/test/java/org/apache/doris/qe/OlapQueryCacheTest.java b/fe/fe-core/src/test/java/org/apache/doris/qe/OlapQueryCacheTest.java index b152bdc3909647..b29a9a4119caa1 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/qe/OlapQueryCacheTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/qe/OlapQueryCacheTest.java @@ -344,15 +344,6 @@ private void setPartitionItem(PartitionInfo partInfo, Partition partition, Colum } } - private ScanNode createOrderScanNode(Collection selectedPartitionIds) { - OlapTable table = createOrderTable(); - TupleDescriptor desc = new TupleDescriptor(new TupleId(10004)); - desc.setTable(table); - OlapScanNode node = new OlapScanNode(new PlanNodeId(10008), desc, "ordernode"); - node.setSelectedPartitionIds(selectedPartitionIds); - return node; - } - private OlapTable createProfileTable() { Column column2 = new Column("eventdate", ScalarType.DATE); Column column3 = new Column("userid", ScalarType.INT); @@ -607,21 +598,6 @@ public void testWithinMinTime() throws Exception { Assert.assertEquals(ca.getCacheMode(), CacheMode.None); } - // @Test - // public void testPartitionModel() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT eventdate, COUNT(DISTINCT userid) FROM appevent WHERE eventdate>=\"2020-01-12\" and " - // + "eventdate<=\"2020-01-15\" GROUP BY eventdate" - // ); - // - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); - // } - @Test public void testParseByte() throws Exception { RowBatchBuilder sb = new RowBatchBuilder(CacheMode.Partition); @@ -634,91 +610,6 @@ public void testParseByte() throws Exception { Assert.assertEquals(key2.realValue(), 3); } - // @Test - // public void testPartitionIntTypeSql() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT `date`, COUNT(id) FROM `order` WHERE `date`>=20200112 and `date`<=20200115 GROUP BY date" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createOrderScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // cache.rewriteSelectStmt(null); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause(), null); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // LOG.warn("Rewrite partition range size={}", size); - // Assert.assertEquals(size, 4); - // - // String sql; - // range.setCacheFlag(20200112L); //get data from cache - // range.setCacheFlag(20200113L); //get data from cache - // - // hitRange = range.buildDiskPartitionRange(newRangeList); - // Assert.assertEquals(hitRange, Cache.HitRange.Left); - // Assert.assertEquals(newRangeList.size(), 2); - // Assert.assertEquals(newRangeList.get(0).getCacheKey().realValue(), 20200114); - // Assert.assertEquals(newRangeList.get(1).getCacheKey().realValue(), 20200115); - // - // cache.rewriteSelectStmt(newRangeList); - // sql = ca.getRewriteStmt().getWhereClause().toSql(); - // Assert.assertEquals(sql, "(`date` >= 20200114) AND (`date` <= 20200115)"); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - - // @Test - // public void testSimpleCacheSql() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT eventdate, COUNT(userid) FROM appevent WHERE eventdate>=\"2020-01-12\" and " - // + "eventdate<=\"2020-01-15\" GROUP BY eventdate" - // ); - // - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // cache.rewriteSelectStmt(null); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause(), null); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // LOG.warn("Rewrite partition range size={}", size); - // Assert.assertEquals(size, 4); - // - // String sql; - // range.setCacheFlag(20200112L); //get data from cache - // range.setCacheFlag(20200113L); //get data from cache - // - // hitRange = range.buildDiskPartitionRange(newRangeList); - // cache.rewriteSelectStmt(newRangeList); - // sql = ca.getRewriteStmt().getWhereClause().toSql(); - // Assert.assertEquals(sql, "(`eventdate` >= '2020-01-14') AND (`eventdate` <= '2020-01-15')"); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - @Test public void testHitSqlCache() throws Exception { StatementBase parseStmt = parseSql( @@ -733,306 +624,6 @@ public void testHitSqlCache() throws Exception { Assert.assertEquals(ca.getCacheMode(), CacheMode.Sql); } - // @Test - // public void testHitPartPartition() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT eventdate, COUNT(userid) FROM appevent WHERE eventdate>=\"2020-01-12\" and " - // + "eventdate<=\"2020-01-14\" GROUP BY eventdate" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1578675600000L); // set now to 2020-01-11 1:00:00, for hit partition cache - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // - // cache.rewriteSelectStmt(null); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause(), null); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // LOG.warn("Rewrite partition range size={}", size); - // Assert.assertEquals(size, 3); - // - // range.setCacheFlag(20200113); - // range.setCacheFlag(20200114); - // - // hitRange = range.buildDiskPartitionRange(newRangeList); - // Assert.assertEquals(hitRange, Cache.HitRange.Right); - // Assert.assertEquals(newRangeList.size(), 2); - // Assert.assertEquals(newRangeList.get(0).getCacheKey().realValue(), 20200112); - // Assert.assertEquals(newRangeList.get(1).getCacheKey().realValue(), 20200112); - // - // List updateRangeList = range.buildUpdatePartitionRange(); - // Assert.assertEquals(updateRangeList.size(), 1); - // Assert.assertEquals(updateRangeList.get(0).getCacheKey().realValue(), 20200112); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - - // @Test - // public void testNoUpdatePartition() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT eventdate, COUNT(userid) FROM appevent WHERE eventdate>=\"2020-01-12\" and " - // + "eventdate<=\"2020-01-14\" GROUP BY eventdate" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1578675600000L); // set now to 2020-01-11 1:00:00, for hit partition cache - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // - // cache.rewriteSelectStmt(null); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause(), null); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // LOG.warn("Rewrite partition range size={}", size); - // Assert.assertEquals(size, 3); - // - // range.setCacheFlag(20200112); //get data from cache - // range.setCacheFlag(20200113); - // range.setCacheFlag(20200114); - // - // hitRange = range.buildDiskPartitionRange(newRangeList); - // Assert.assertEquals(hitRange, Cache.HitRange.Full); - // Assert.assertEquals(newRangeList.size(), 0); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - - // @Test - // public void testUpdatePartition() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT eventdate, COUNT(userid) FROM appevent WHERE eventdate>=\"2020-01-12\" and " - // + "eventdate<=\"2020-01-15\" GROUP BY eventdate" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // - // cache.rewriteSelectStmt(null); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause(), null); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // LOG.warn("Rewrite partition range size={}", size); - // Assert.assertEquals(size, 4); - // - // String sql; - // range.setCacheFlag(20200112L); //get data from cache - // range.setTooNewByKey(20200115); - // - // range.buildDiskPartitionRange(newRangeList); - // Assert.assertEquals(newRangeList.size(), 2); - // cache.rewriteSelectStmt(newRangeList); - // - // sql = ca.getRewriteStmt().getWhereClause().toSql(); - // Assert.assertEquals(sql, "(`eventdate` >= '2020-01-13') AND (`eventdate` <= '2020-01-15')"); - // - // List updateRangeList = range.buildUpdatePartitionRange(); - // Assert.assertEquals(updateRangeList.size(), 2); - // Assert.assertEquals(updateRangeList.get(0).getCacheKey().realValue(), 20200113); - // Assert.assertEquals(updateRangeList.get(1).getCacheKey().realValue(), 20200114); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - - // @Test - // public void testRewriteMultiPredicate1() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT eventdate, COUNT(userid) FROM appevent WHERE eventdate>\"2020-01-11\" and " - // + "eventdate<\"2020-01-16\"" - // + " and eventid=1 GROUP BY eventdate" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // - // cache.rewriteSelectStmt(null); - // LOG.warn("Nokey multi={}", cache.getNokeyStmt().getWhereClause().toSql()); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause().toSql(), "(`eventid` = 1)"); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // Assert.assertEquals(size, 4); - // - // String sql; - // range.setCacheFlag(20200112L); //get data from cache - // range.setCacheFlag(20200113L); //get data from cache - // - // range.buildDiskPartitionRange(newRangeList); - // - // cache.rewriteSelectStmt(newRangeList); - // sql = ca.getRewriteStmt().getWhereClause().toSql(); - // LOG.warn("MultiPredicate={}", sql); - // Assert.assertEquals(sql, "(`eventdate` > '2020-01-13') AND (`eventdate` < '2020-01-16') AND (`eventid` = 1)"); - // } catch (Exception e) { - // LOG.warn("multi ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - - // @Test - // public void testRewriteJoin() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT appevent.eventdate, country, COUNT(appevent.userid) FROM appevent" - // + " INNER JOIN userprofile ON appevent.userid = userprofile.userid" - // + " WHERE appevent.eventdate>=\"2020-01-12\" and appevent.eventdate<=\"2020-01-15\"" - // + " and eventid=1 GROUP BY appevent.eventdate, country" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // cache.rewriteSelectStmt(null); - // LOG.warn("Join nokey={}", cache.getNokeyStmt().getWhereClause().toSql()); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause().toSql(), "(`eventid` = 1)"); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // Assert.assertEquals(size, 4); - // - // String sql; - // range.setCacheFlag(20200112L); //get data from cache - // range.setCacheFlag(20200113L); //get data from cache - // - // range.buildDiskPartitionRange(newRangeList); - // - // cache.rewriteSelectStmt(newRangeList); - // sql = ca.getRewriteStmt().getWhereClause().toSql(); - // LOG.warn("Join rewrite={}", sql); - // Assert.assertEquals(sql, "(`appevent`.`eventdate` >= '2020-01-14')" - // + " AND (`appevent`.`eventdate` <= '2020-01-15') AND (`eventid` = 1)"); - // } catch (Exception e) { - // LOG.warn("Join ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - - // @Test - // public void testSubSelect() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT eventdate, sum(pv) FROM (SELECT eventdate, COUNT(userid) AS pv FROM appevent WHERE " - // + "eventdate>\"2020-01-11\" AND eventdate<\"2020-01-16\"" - // + " AND eventid=1 GROUP BY eventdate) tbl GROUP BY eventdate" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // - // cache.rewriteSelectStmt(null); - // LOG.warn("Sub nokey={}", cache.getNokeyStmt().toSql()); - // Assert.assertEquals(cache.getNokeyStmt().toSql(), - // "SELECT `eventdate` AS `eventdate`, sum(`pv`) AS `sum(``pv``)` " - // + "FROM (SELECT `eventdate`, count(`userid`) `pv` " - // + "FROM `testDb`.`appevent` WHERE (`eventid` = 1) GROUP BY `eventdate`) tbl " - // + "GROUP BY `eventdate`"); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // Assert.assertEquals(size, 4); - // - // String sql; - // range.setCacheFlag(20200112L); //get data from cache - // range.setCacheFlag(20200113L); //get data from cache - // - // range.buildDiskPartitionRange(newRangeList); - // - // cache.rewriteSelectStmt(newRangeList); - // sql = ca.getRewriteStmt().toSql(); - // LOG.warn("Sub rewrite={}", sql); - // Assert.assertEquals(sql, - // "SELECT `eventdate` AS `eventdate`, sum(`pv`) AS `sum(``pv``)` " - // + "FROM (SELECT `eventdate`, count(`userid`) `pv` " - // + "FROM `testDb`.`appevent` WHERE (`eventdate` > '2020-01-13') " - // + "AND (`eventdate` < '2020-01-16') AND (`eventid` = 1) GROUP BY `eventdate`) tbl " - // + "GROUP BY `eventdate`"); - // } catch (Exception e) { - // LOG.warn("sub ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - - // @Test - // public void testNotHitPartition() throws Exception { - // StatementBase parseStmt = parseSql( - // "SELECT eventdate, COUNT(userid) FROM appevent WHERE eventdate>=\"2020-01-12\" and " - // + "eventdate<=\"2020-01-14\" GROUP BY eventdate" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1578675600000L); // set now to 2020-01-11 1:00:00, for hit partition cache - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // cache.rewriteSelectStmt(null); - // PartitionRange range = cache.getPartitionRange(); - // range.analytics(); - // hitRange = range.buildDiskPartitionRange(newRangeList); - // Assert.assertEquals(hitRange, Cache.HitRange.None); - // Assert.assertEquals(newRangeList.size(), 2); - // Assert.assertEquals(newRangeList.get(0).getCacheKey().realValue(), 20200112); - // Assert.assertEquals(newRangeList.get(1).getCacheKey().realValue(), 20200114); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - @Test public void testSqlCacheKey() { StatementBase parseStmt = parseSql( @@ -1167,65 +758,6 @@ public void testSqlCacheKeyWithSubSelectViewForNereids() { Assert.assertEquals(selectedPartitionIds.size(), sqlCache.getSumOfPartitionNum()); } - // @Test - // public void testPartitionCacheKeyWithView() { - // StatementBase parseStmt = parseSql("SELECT * from testDb.view3"); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // - // cache.rewriteSelectStmt(null); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause(), null); - // Assert.assertEquals(cache.getSqlWithViewStmt(), "SELECT `testDb`.`view3`.`eventdate` " - // + "AS `eventdate`, `testDb`.`view3`.`__count_1` AS `__count_1` " - // + "FROM `testDb`.`view3`|SELECT `eventdate` AS `eventdate`, count(`userid`) " - // + "AS `__count_1` FROM `testDb`.`appevent` WHERE (`eventdate` >= '2020-01-12') " - // + "AND (`eventdate` <= '2020-01-15') GROUP BY `eventdate`"); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - - // @Test - // public void testPartitionCacheKeyWithSubSelectView() { - // StatementBase parseStmt = parseSql( - // "select origin.eventdate as eventdate, origin.cnt as cnt\n" - // + "from (\n" - // + " SELECT eventdate, COUNT(userid) as cnt \n" - // + " FROM view2 \n" - // + " WHERE eventdate>=\"2020-01-12\" and eventdate<=\"2020-01-15\" GROUP BY eventdate\n" - // + ") origin" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createEventScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // - // cache.rewriteSelectStmt(null); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause(), null); - // Assert.assertEquals(cache.getSqlWithViewStmt(), - // "SELECT `origin`.`eventdate` AS `eventdate`, `origin`.`cnt` AS `cnt` " - // + "FROM (SELECT `eventdate`, count(`userid`) `cnt` " - // + "FROM `testDb`.`view2` GROUP BY `eventdate`) origin|SELECT `eventdate` " - // + "AS `eventdate`, `userid` AS `userid` FROM `testDb`.`appevent`"); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } - @Test public void testSqlCacheKeyWithNestedView() { StatementBase parseStmt = parseSql("SELECT * from testDb.view4"); @@ -1286,48 +818,4 @@ public void testCacheLocalViewMultiOperand() { Assert.assertEquals(ca.getCacheMode(), CacheMode.Sql); Assert.assertEquals(selectedPartitionIds.size() * 3, ((SqlCache) ca.getCache()).getSumOfPartitionNum()); } - - // @Test - // // test that some partitions do not exist in the table - // public void testNotExistPartitionSql() { - // StatementBase parseStmt = parseSql( - // "SELECT `date`, COUNT(id) FROM `order` WHERE `date`>=20200110 and `date`<=20200115 GROUP BY date" - // ); - // ArrayList selectedPartitionIds - // = Lists.newArrayList(20200112L, 20200113L, 20200114L, 20200115L); - // List scanNodes = Lists.newArrayList(createOrderScanNode(selectedPartitionIds)); - // CacheAnalyzer ca = new CacheAnalyzer(context, parseStmt, scanNodes); - // ca.checkCacheMode(1579053661000L); //2020-1-15 10:01:01 - // Assert.assertEquals(ca.getCacheMode(), CacheMode.Partition); //assert cache model first - // try { - // PartitionCache cache = (PartitionCache) ca.getCache(); - // cache.rewriteSelectStmt(null); - // Assert.assertEquals(cache.getNokeyStmt().getWhereClause(), null); - // - // PartitionRange range = cache.getPartitionRange(); - // boolean flag = range.analytics(); - // Assert.assertEquals(flag, true); - // - // int size = range.getPartitionSingleList().size(); - // LOG.warn("Rewrite partition range size={}", size); - // Assert.assertEquals(size, 4); - // - // String sql; - // range.setCacheFlag(20200112L); //get data from cache - // range.setCacheFlag(20200113L); //get data from cache - // - // hitRange = range.buildDiskPartitionRange(newRangeList); - // Assert.assertEquals(hitRange, Cache.HitRange.Left); - // Assert.assertEquals(newRangeList.size(), 2); - // Assert.assertEquals(newRangeList.get(0).getCacheKey().realValue(), 20200114); - // Assert.assertEquals(newRangeList.get(1).getCacheKey().realValue(), 20200115); - // - // cache.rewriteSelectStmt(newRangeList); - // sql = ca.getRewriteStmt().getWhereClause().toSql(); - // Assert.assertEquals(sql, "(`date` >= 20200114) AND (`date` <= 20200115)"); - // } catch (Exception e) { - // LOG.warn("ex={}", e); - // Assert.fail(e.getMessage()); - // } - // } } diff --git a/regression-test/suites/nereids_p0/cache/partition_cache.groovy b/regression-test/suites/nereids_p0/cache/partition_cache.groovy deleted file mode 100644 index 84c48b6377bf3a..00000000000000 --- a/regression-test/suites/nereids_p0/cache/partition_cache.groovy +++ /dev/null @@ -1,312 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// The cases is copied from https://github.com/trinodb/trino/tree/master -// /testing/trino-product-tests/src/main/resources/sql-tests/testcases/aggregate -// and modified by Doris. - -suite("partition_cache") { - // TODO: use mv transparent rewriting function to refactor partition cache - return; - -// sql "SET enable_nereids_planner=true" -// sql "SET enable_fallback_to_original_planner=false" -// def tableName = "test_partition_cache" -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` date NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01'), ('2022-06-01')), -// PARTITION p202206 VALUES [('2022-06-01'), ('2022-07-01'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// -// sql "sync" -// -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27",0), -// ("2022-05-28",0), -// ("2022-05-29",0), -// ("2022-05-30",0), -// ("2022-06-01",0), -// ("2022-06-02",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28' and '2022-06-30' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28' and '2022-06-30' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` datev2 NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01'), ('2022-06-01')), -// PARTITION p202206 VALUES [('2022-06-01'), ('2022-07-01'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27",0), -// ("2022-05-28",0), -// ("2022-05-29",0), -// ("2022-05-30",0), -// ("2022-06-01",0), -// ("2022-06-02",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28' and '2022-06-30' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28' and '2022-06-30' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` datetimev2(3) NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01 11:11:11.111'), ('2022-06-01 11:11:11.111')), -// PARTITION p202206 VALUES [('2022-06-01 11:11:11.111'), ('2022-07-01 11:11:11.111'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27 11:11:11.111",0), -// ("2022-05-28 11:11:11.111",0), -// ("2022-05-29 11:11:11.111",0), -// ("2022-05-30 11:11:11.111",0), -// ("2022-06-01 11:11:11.111",0), -// ("2022-06-02 11:11:11.111",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` datetimev2(3) NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01 11:11:11.111111'), ('2022-06-01 11:11:11.111111')), -// PARTITION p202206 VALUES [('2022-06-01 11:11:11.111111'), ('2022-07-01 11:11:11.111111'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27 11:11:11.111",0), -// ("2022-05-28 11:11:11.111",0), -// ("2022-05-29 11:11:11.111",0), -// ("2022-05-30 11:11:11.111",0), -// ("2022-06-01 11:11:11.111",0), -// ("2022-06-02 11:11:11.111",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` datetimev2(6) NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01 11:11:11.111'), ('2022-06-01 11:11:11.111')), -// PARTITION p202206 VALUES [('2022-06-01 11:11:11.111'), ('2022-07-01 11:11:11.111'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27 11:11:11.111111",0), -// ("2022-05-28 11:11:11.111111",0), -// ("2022-05-29 11:11:11.111111",0), -// ("2022-05-30 11:11:11.111111",0), -// ("2022-06-01 11:11:11.111111",0), -// ("2022-06-02 11:11:11.111111",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -} diff --git a/regression-test/suites/query_p0/cache/partition_cache.groovy b/regression-test/suites/query_p0/cache/partition_cache.groovy deleted file mode 100644 index c202542d40d8b7..00000000000000 --- a/regression-test/suites/query_p0/cache/partition_cache.groovy +++ /dev/null @@ -1,313 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// The cases is copied from https://github.com/trinodb/trino/tree/master -// /testing/trino-product-tests/src/main/resources/sql-tests/testcases/aggregate -// and modified by Doris. - -suite("partition_cache") { - // TODO: use mv transparent rewriting function to refactor partition cache - return; - -// // TODO: regression-test does not support check query profile, -// // so this suite does not check whether cache is used, :) -// def tableName = "test_partition_cache" -// sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '0')" -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` date NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01'), ('2022-06-01')), -// PARTITION p202206 VALUES [('2022-06-01'), ('2022-07-01'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// -// sql "sync" -// -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27",0), -// ("2022-05-28",0), -// ("2022-05-29",0), -// ("2022-05-30",0), -// ("2022-06-01",0), -// ("2022-06-02",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28' and '2022-06-30' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28' and '2022-06-30' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` datev2 NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01'), ('2022-06-01')), -// PARTITION p202206 VALUES [('2022-06-01'), ('2022-07-01'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27",0), -// ("2022-05-28",0), -// ("2022-05-29",0), -// ("2022-05-30",0), -// ("2022-06-01",0), -// ("2022-06-02",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28' and '2022-06-30' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28' and '2022-06-30' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` datetimev2(3) NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01 11:11:11.111'), ('2022-06-01 11:11:11.111')), -// PARTITION p202206 VALUES [('2022-06-01 11:11:11.111'), ('2022-07-01 11:11:11.111'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27 11:11:11.111",0), -// ("2022-05-28 11:11:11.111",0), -// ("2022-05-29 11:11:11.111",0), -// ("2022-05-30 11:11:11.111",0), -// ("2022-06-01 11:11:11.111",0), -// ("2022-06-02 11:11:11.111",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` datetimev2(3) NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01 11:11:11.111111'), ('2022-06-01 11:11:11.111111')), -// PARTITION p202206 VALUES [('2022-06-01 11:11:11.111111'), ('2022-07-01 11:11:11.111111'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27 11:11:11.111",0), -// ("2022-05-28 11:11:11.111",0), -// ("2022-05-29 11:11:11.111",0), -// ("2022-05-30 11:11:11.111",0), -// ("2022-06-01 11:11:11.111",0), -// ("2022-06-02 11:11:11.111",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -// -// sql """ DROP TABLE IF EXISTS ${tableName} """ -// sql """ -// CREATE TABLE IF NOT EXISTS ${tableName} ( -// `k1` datetimev2(6) NOT NULL COMMENT "", -// `k2` int(11) NOT NULL COMMENT "" -// ) ENGINE=OLAP -// DUPLICATE KEY(`k1`, `k2`) -// COMMENT "OLAP" -// PARTITION BY RANGE(`k1`) -// (PARTITION p202205 VALUES [('2022-05-01 11:11:11.111'), ('2022-06-01 11:11:11.111')), -// PARTITION p202206 VALUES [('2022-06-01 11:11:11.111'), ('2022-07-01 11:11:11.111'))) -// DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 32 -// PROPERTIES ( -// "replication_allocation" = "tag.location.default: 1", -// "in_memory" = "false", -// "storage_format" = "V2" -// ) -// """ -// sql """ INSERT INTO ${tableName} VALUES -// ("2022-05-27 11:11:11.111111",0), -// ("2022-05-28 11:11:11.111111",0), -// ("2022-05-29 11:11:11.111111",0), -// ("2022-05-30 11:11:11.111111",0), -// ("2022-06-01 11:11:11.111111",0), -// ("2022-06-02 11:11:11.111111",0) -// """ -// sql " set enable_partition_cache=true " -// -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// qt_partition_cache """ -// select -// k1, -// sum(k2) as total_pv -// from -// ${tableName} -// where -// k1 between '2022-05-28 11:11:11.111' and '2022-06-30 11:11:11.111' -// group by -// k1 -// order by -// k1; -// """ -// sql " set enable_partition_cache=false " -}