Describe the bug
When a query executed with cache enabled, it returns error:
2021-04-26 16:18:25,898 WARN (doris-mysql-nio-pool-3|156) [StmtExecutor.execute():337] execute Exception
java.lang.NullPointerException: null at org.apache.doris.qe.cache.CacheProxy$FetchCacheResult.setResult(CacheProxy.java:229) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.CacheBeProxy.fetchCache(CacheBeProxy.java:97) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.SqlCache.getCacheData(SqlCache.java:44) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.CacheAnalyzer.getCacheData(CacheAnalyzer.java:280) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.handleCacheStmt(StmtExecutor.java:646) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.handleQueryStmt(StmtExecutor.java:737) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:273) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:192) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:324) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:509) ~[palo-fe.jar:3.4.0] at org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50) ~[palo-fe.jar:3.4.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?]
To Reproduce
Steps to reproduce the behavior:
-
create a table with 3 more partitions, set enable_sql_cache=true:

-
insert some data into partition p201707, this partition becomes the lastest partition

-
query twice this table, the cache has been planted.

-
insert some data into partition p201709, this partition becomes the lastest partition

-
query twice this table, the cache has been planted.

-
insert some data into partition p201708, this partition becomes the lastest partition

-
quey this table, return error

Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Describe the bug
When a query executed with cache enabled, it returns error:
2021-04-26 16:18:25,898 WARN (doris-mysql-nio-pool-3|156) [StmtExecutor.execute():337] execute Exception
java.lang.NullPointerException: null at org.apache.doris.qe.cache.CacheProxy$FetchCacheResult.setResult(CacheProxy.java:229) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.CacheBeProxy.fetchCache(CacheBeProxy.java:97) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.SqlCache.getCacheData(SqlCache.java:44) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.cache.CacheAnalyzer.getCacheData(CacheAnalyzer.java:280) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.handleCacheStmt(StmtExecutor.java:646) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.handleQueryStmt(StmtExecutor.java:737) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:273) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:192) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:324) ~[palo-fe.jar:3.4.0] at org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:509) ~[palo-fe.jar:3.4.0] at org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50) ~[palo-fe.jar:3.4.0] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?]To Reproduce
Steps to reproduce the behavior:
create a table with 3 more partitions, set enable_sql_cache=true:

insert some data into partition p201707, this partition becomes the lastest partition

query twice this table, the cache has been planted.

insert some data into partition p201709, this partition becomes the lastest partition

query twice this table, the cache has been planted.

insert some data into partition p201708, this partition becomes the lastest partition

quey this table, return error

Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.