加入两个 table 并在配置单元中的新 table 中插入值
Join two tables and insert value in a new table in hive
我是新手。我需要知道它是否可能在配置单元中加入两个 tables(比如 customer_table 和 issues_table 基于 CustomedId 列)并在配置单元中使用新的 table 插入值插入覆盖?
是的,可以使用 CTAS (create table new_table as select ...
) 语法。
create table new_table as select * from customer_table, issues_table where customer_table.CustomedId = issues_table.CustomedId;
在生产中使用此查询 运行。我有数以百万计的记录,它工作起来没有任何麻烦,也很快。全面测试。
create table new_table as select * from customer_table t1 where t1.CustomedId NOT IN (Select t2.CustomedId FROM issues_table t2);
我是新手。我需要知道它是否可能在配置单元中加入两个 tables(比如 customer_table 和 issues_table 基于 CustomedId 列)并在配置单元中使用新的 table 插入值插入覆盖?
是的,可以使用 CTAS (create table new_table as select ...
) 语法。
create table new_table as select * from customer_table, issues_table where customer_table.CustomedId = issues_table.CustomedId;
在生产中使用此查询 运行。我有数以百万计的记录,它工作起来没有任何麻烦,也很快。全面测试。
create table new_table as select * from customer_table t1 where t1.CustomedId NOT IN (Select t2.CustomedId FROM issues_table t2);