我正在尝试为我正在创建的物化视图对原始表进行聚类,并将其用作参考。但是,在尝试将视图权限添加到具有 SYSADMIN 角色的另一个用户时,我遇到了权限错误。
USE WAREHOUSE "TEST...";
USE DATABASE "TEST";
CREATE OR REPLACE TABLE ArticleLibrary (id int, Title string, Genre string, Viewed number, date_captured timestamp );
INSERT INTO ArticleLibrary VALUES
(1, 'The Kite Runner', 'Non-Fiction', 10, CURRENT_DATE() ),
(2, 'The Curious Incident of the Dog in the Night-time', 'Fiction', 20 , CURRENT_DATE());
CREATE MATERIALIZED VIEW Article_Library_view_date
COMMENT='Test view'
AS
SELECT ID, TITLE, GENRE, date_captured FROM ArticleLibrary;
ALTER MATERIALIZED VIEW Article_Library_view_date CLUSTER BY(to_date(date_captured),genre);
SHOW MATERIALIZED VIEWS;
SELECT * FROM Article_Library_view_date CLUSTER;
//CREATE SCHEMA test_schema;
//GRANT SELECT ON ALL TABLES IN SCHEMA TEST.test_schema to SYSADMIN;
我尝试在界面中从 SECURITYADMIN 角色向 SYSADMIN 添加修改权限,但它是由另一个 SYSADMIN 角色创建的。如何排查角色问题?
我看到GRANT SELECT语句在SYSADMIN之前缺少ROLE一词。 除此之外,我不确定该如何处理代码,因为架构是在视图之后创建的,那么在哪里创建视图以及由哪个角色创建?