EError while compiling statement: FAILED: SemanticException [Error 10036]: Duplicate column name:

创建表的时候报如下错误:

Error: Error while compiling statement: FAILED: SemanticException [Error 10036]: Duplicate column name: content_id (state=42000,code=10036)
create table temp.temp_zhibo_0423 as
select a.*, b.*
  from
(
select *
  from ods.log
 where src_file_day = '20190423'
) a
left join
(
select *
  from pub.program
 where dt = '20190423'
) b
on a.program_id = b.epg_id;

原因分析:在两个子查询中都有名称为content_id的字段,创建表时不能有相同的字段名称,所以报错。

解决方法:将相同字段名称的字段更改为不一样就OK了。

记录下

猜你喜欢

转载自blog.csdn.net/lz6363/article/details/89489553