嗨,我正在尝试自动化 Airflow 中的工作流程,我将每天将行附加到外部 Spectrum 表中,我需要通过提取现有表的计数 + 新表来更改频谱表上的 numRows我要附加的行数。
CREATE EXTERNAL TABLE spectrum.my_external_table
(
id INTEGER,barkdata_timestamp timestamp,created_at timestamp,updated_at timestamp
)
PARTITIONED BY (asofdate timestamp)
STORED AS ParqUET
LOCATION 's3://<SOME BUCKET>/manifest'
table properties ('numRows'= '<some number>';
ALTER TABLE spectrum.my_external_table
ADD PARTITION (asofdate='2021-03-03 00:00:00') LOCATION 's3://<SOME BUCKET>/asofdate=2021-03-03 00:00:00/';
ALTER TABLE spectrum.couponable_coupon
SET TABLE PROPERTIES ('numRows'='<HELP HERE should be count(*) from my_external_table + count(*) from table_I_unloaded_to_s3 where asofdate='2021-03-03 00:00:00'>');