Chao Sun created SPARK-34108:
--------------------------------
Summary: Caching doesn't work completely with permanent view
Key: SPARK-34108
URL: https://issues.apache.org/jira/browse/SPARK-34108
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 3.1.0
Reporter: Chao Sun
Currently, caching a permanent view doesn't work in some cases. For instance,
in the following:
{code}
CREATE TABLE t (key bigint, value string) USING parquet
CREATE VIEW v1 AS SELECT key FROM t
CACHE TABLE v1
SELECT key FROM t
{code}
The last SELECT query will hit the cached {{v1}}. However, in the following:
{code}
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
{code}
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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]