cloud-fan commented on code in PR #53333: URL: https://github.com/apache/spark/pull/53333#discussion_r2612929065
########## sql/core/src/test/resources/sql-tests/results/cache.sql.out: ########## @@ -0,0 +1,293 @@ +-- Automatically generated by SQLQueryTestSuite +-- !query +CREATE TEMPORARY VIEW t1 AS SELECT * FROM VALUES (0, 0), (1, 1), (2, 2) AS t(c1, c2) +-- !query schema +struct<> +-- !query output + + + +-- !query +CREATE TEMPORARY VIEW t2 AS +WITH v as ( + SELECT c1 + c1 c3 FROM t1 +) +SELECT SUM(c3) s FROM v +-- !query schema +struct<> +-- !query output + + + +-- !query +CACHE TABLE cache_table +WITH +t2 AS (SELECT 1) +SELECT * FROM t2 +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT * FROM cache_table +-- !query schema +struct<1:int> +-- !query output +1 + + +-- !query +EXPLAIN EXTENDED SELECT * FROM cache_table +-- !query schema +struct<plan:string> +-- !query output +== Parsed Logical Plan == +'Project [*] ++- 'UnresolvedRelation [cache_table], [], false + +== Analyzed Logical Plan == +1: int +Project [1#x] ++- SubqueryAlias cache_table + +- View (`cache_table`, [1#x]) + +- Project [cast(1#x as int) AS 1#x] + +- WithCTE + :- CTERelationDef xxxx, false + : +- SubqueryAlias t2 + : +- Project [1 AS 1#x] + : +- OneRowRelation + +- Project [1#x] + +- SubqueryAlias t2 + +- CTERelationRef xxxx, true, [1#x], false, false, 1 + +== Optimized Logical Plan == +InMemoryRelation [1#x], StorageLevel(disk, memory, deserialized, 1 replicas) + +- *Project [1 AS 1#x] + +- *Scan OneRowRelation[] + +== Physical Plan == +Scan In-memory table cache_table [1#x] Review Comment: can we write scala test instead? it's hard to verify cache scan with full EXPLAIN output. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
