Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
3.1.0
-
None
-
None
Description
Currently, caching a temporary or permenant view doesn't work in certain cases. For instance, in the following:
CREATE TABLE t (key bigint, value string) USING parquet CREATE VIEW v1 AS SELECT key FROM t CACHE TABLE v1 SELECT key FROM t
The last SELECT query will hit the cached v1. On the other hand:
CREATE TABLE t (key bigint, value string) USING parquet CREATE VIEW v1 AS SELECT key FROM t ORDER by key CACHE TABLE v1 SELECT key FROM t ORDER BY key
The SELECT won't hit the cache.
It seems this is related to EliminateView. In the second case, it will insert an extra project operator which makes the comparison on canonicalized plan during cache lookup fail.
Attachments
Issue Links
- is duplicated by
-
SPARK-34269 simplify view resolution
- Resolved
- is related to
-
SPARK-33647 cache table not working for persisted view
- Resolved
- links to