当我删除缓存的temp视图时,spark应用程序是否清除缓存?
我在下面添加了一些片段,以给出关于这个问题的更多细节。
CREATE TEMPORARY VIEW temp_view_1 AS
SELECT
column1,
column2
FROM Table1;
CACHE TABLE temp_view_1;
CREATE TEMPORARY VIEW temp_view_2 AS
SELECT
/*+ BROADCAST(b) */
a.column1,
a.column2
FROM Table2 a JOIN temp_view_1 b ON a.column1 = b.column1 ;
CREATE TEMPORARY VIEW temp_view_3 AS
SELECT
/*+ BROADCAST(b) */
a.column1,
a.column2
FROM Table3 a JOIN temp_view_1 b ON a.column1 = b.column1 ;
DROP TABLE temp_view_1; -- Does this statement clear the cache as well ? If not, how can I clear cache ?
SELECT
a.column1,
a.column2
FROM temp_view_2 a JOIN temp_view_3 b ON a.column1 = b.column1 ;问题是,像DROP temp_view_1这样的语句是否也清除了缓存?如果没有,我如何清除缓存?
发布于 2021-06-24 08:08:36
您只需将DROP VIEW用于%sql,如果缓存已被缓存,则缓存将被清除。手册指出,这也是合乎逻辑的。别担心。
发布于 2021-06-24 13:17:09
使用dropTempView函数。
您可以在目录类下找到这个函数。
https://stackoverflow.com/questions/68110775
复制相似问题