我正在尝试了解 Spark SQL 中的各种缓存机制。下面的代码片段有什么区别吗:
cache table test_cache AS
select a, b, c
from x
inner join y
on x.a = y.a;
Run Code Online (Sandbox Code Playgroud)
create temporary view test_cache AS
select a, b, c
from x
inner join y
on x.a = y.a;
cache table test_cache;
Run Code Online (Sandbox Code Playgroud)
由于 Spark 中的计算是惰性的,Spark 会在方法 2 中第一次创建临时表时缓存结果吗?或者它会等待任何收集应用于它?