我们创建了如下模式:
create external schema spectrum
from data catalog
database 'test'
iam_role 'arn:aws:iam::20XXXXXXXXXXX:role/athenaaccess'
create external database if not exists;
和表格如下:
create external table spectrum.Customer(
Subr_Id integer,
SUB_CURRENTSTATUS varchar(100),
AIN integer,
ACCOUNT_CREATED timestamp,
Subr_Name varchar(100),
LAST_DEACTIVATED timestamp)
partitioned by (LAST_ACTIVATION timestamp)
row format delimited
fields terminated by ','
stored as textfile
location 's3://cequity-redshiftspectrum-test/'
table properties ('numRows'='1000');
访问权限如下:
athenaQuickSight 访问、完全 Athena 访问和 s3 完全访问的角色附加到 redshift 集群
但是,当我们如下查询时,我们得到 0 条记录。请帮忙。
select count(*) from spectrum.Customer;