为什么雪花临时表的创建者不是其所有者?

时间:2020-01-05 00:46:20

标签: snowflake-cloud-data-platform

我正在运行以下代码。如您所见,我正在使用一个名为owner_bi_db的角色来创建一个临时表。

use database bi_db;
use schema [my_schema];

use role accountadmin;
drop table if exists _test;

use role owner_bi_db;
create temporary table _test as select 1 as t;

use role accountadmin;
show tables like '_test';

即使owner_bi_db是临时表的创建者,所有者最终还是DEV_ROLE。那怎么可能?我认为所有权始终授予该对象的创建者。无论是在临时表还是常规表上都一样。

enter image description here

1 个答案:

答案 0 :(得分:4)

啊!我找到了。在表的架构上,我们有一个将来的 ownership 授予,它会覆盖create授予。有趣。

enter image description here