如何在vvp作业中定义Hologres作为数据汇(Sink)的临时表?
"在vvp作业中定义Hologres作为数据汇(Sink)的临时表,可以使用以下SQL代码:
sql复制代码
CREATE TEMPORARY TABLE consume(
appkey STRING,
serverid STRING,
servertime STRING,
roleid STRING,
amount DOUBLE,
dt STRING,
PRIMARY KEY (appkey,dt) NOT ENFORCED
) WITH (
'connector' = 'hologres',
'dbname' = 'mydb',
'endpoint' = 'hgprecn-cn-tl32gkaet006-cn-beijing-vpc.hologres.aliyuncs.com:80',
'password' = '[your appkey secret]',
'tablename' = 'consume',
'username' = '[your app key]',
'mutateType' = 'insertorreplace'
);
--""appkey"":""appkey1"",""servertime"":""2020-09-30
14:10:36"",""consumenum"":33.8,""roleid"":""roleid1"",""serverid"":""1""
--""appkey"":""appkey2"",""servertime"":""2020-09-30 14:11:36"",""consumenum"":30.8,""roleid"":""roleid2"",""serverid"":""2""
--""appkey"":""appkey1"",""servertime"":""2020-09-30 14:13:36"",""consumenum"":31.8,""roleid"":""roleid1"",""serverid"":""1""
--""appkey"":""appkey2"",""servertime"":""2020-09-30 14:20:36"",""consumenum"":33.8,""roleid"":""roleid2"",""serverid"":""2""
--""appkey"":""appkey1"",""servertime"":""2020-09-30 14:30:36"",""consumenum"":73.8,""roleid"":""roleid1"",""serverid"":""1""
这段SQL代码定义了一个名为consume的临时表,它连接到Hologres数据库的一个表,用于将处理后的数据写入。这里配置了Hologres的连接信息、数据库名、表名以及数据写入的方式(insertorreplace)。"
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。