Hive insert into table from select statement with different schemas
Hive insert into table from select statement with different schemas
对于 Hive 中的两个表:
Schema of Table A:
id name age
Schema of Table B:
name
# The type of "name" in Table A and B are both string
我想 select 来自 Table B
的所有行,然后将它们追加到 Table A
,让列 id
和 age
为空。
由于列数不同
,以下语句将不起作用
insert into Table_A
select * from Table_B
;
是否有任何可行的方法来附加数据?
insert into table Table_A select null,name,null from Table_B;
对于 Hive 中的两个表:
Schema of Table A:
id name age
Schema of Table B:
name
# The type of "name" in Table A and B are both string
我想 select 来自 Table B
的所有行,然后将它们追加到 Table A
,让列 id
和 age
为空。
由于列数不同
,以下语句将不起作用insert into Table_A
select * from Table_B
;
是否有任何可行的方法来附加数据?
insert into table Table_A select null,name,null from Table_B;