@Override
    public FileCacheInfo getPartitionFileCacheInfo(long partitionId) {
        FileCacheInfo cacheInfo = null;
        DataCacheInfo dataCacheInfo = partitionInfo.getDataCacheInfo(partitionId);
        if (dataCacheInfo == null) {
            cacheInfo = tableProperty.getStorageInfo().getCacheInfo();
        } else {
            cacheInfo = dataCacheInfo.getCacheInfo();
        }
        return cacheInfo;
    }
@Test
    public void testCreateMaterializedView() throws Exception {
        starRocksAssert.withMaterializedView("create materialized view mv1\n" +
                        "distributed by hash(k2) buckets 3\n" +
                        "PROPERTIES(\n" +
                        "   'datacache.enable' = 'true',\n" +
                        "   'enable_async_write_back' = 'false',\n" +
                        "   'datacache.partition_duration' = '6 day'\n" +
                        ")\n" +
                        "refresh async\n" +
                        "as select k2, sum(k3) as total from base_table group by k2;");

        Database db = GlobalStateMgr.getCurrentState().getDb(DB);
        MaterializedView mv = (MaterializedView) db.getTable("mv1");
        Assert.assertTrue(mv.isCloudNativeMaterializedView());
        Assert.assertTrue(mv.isActive());

        LakeMaterializedView lakeMv = (LakeMaterializedView) mv;
        // same as PseudoStarOSAgent.allocateFilePath
        Assert.assertTrue(lakeMv.getDefaultFilePathInfo().getFullPath().startsWith("s3://dummy_unittest_bucket/dummy_sub_path"));
        // check table default cache info
        FileCacheInfo cacheInfo = lakeMv.getPartitionFileCacheInfo(0L);
        Assert.assertTrue(cacheInfo.getEnableCache());
        Assert.assertEquals(-1, cacheInfo.getTtlSeconds());
        Assert.assertFalse(cacheInfo.getAsyncWriteBack());

        // replication num
        Assert.assertEquals(1L, lakeMv.getDefaultReplicationNum().longValue());

        // show create materialized view
        String ddlStmt = lakeMv.getMaterializedViewDdlStmt(true);
        System.out.println(ddlStmt);
        Assert.assertTrue(ddlStmt.contains("\"replication_num\" = \"1\""));
        Assert.assertTrue(ddlStmt.contains("\"datacache.enable\" = \"true\""));
        Assert.assertTrue(ddlStmt.contains("\"enable_async_write_back\" = \"false\""));
        Assert.assertTrue(ddlStmt.contains("\"storage_volume\" = \"builtin_storage_volume\""));
        Assert.assertTrue(ddlStmt.contains("\"datacache.partition_duration\" = \"6 days\""));

        // check task
        String mvTaskName = "mv-" + mv.getId();
        Task task = GlobalStateMgr.getCurrentState().getTaskManager().getTask(mvTaskName);
        Assert.assertNotNull(task);

        starRocksAssert.dropMaterializedView("mv1");
        Assert.assertNull(db.getTable("mv1"));
    }