[ https://issues.apache.org/jira/browse/HIVE-25118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Naresh P R updated HIVE-25118: ------------------------------ Description: create table t1(id int); create table t2(id int); create table t3 as select t1.id, t2.id from t1 join t2; CBO fails if "hive.stats.column.autogather=true" with "SemanticException Ambiguous column reference: id" & CTAS passes with following table schema {code:java} desc t3; +-----------+------------+----------+ | col_name | data_type | comment | +-----------+------------+----------+ | t1.id | int | | | t2.id | int | | +-----------+------------+----------+{code} disabling column stats will fail the query {code:java} set hive.stats.column.autogather=false; create table t3 as select t1.id, t2.id from t1 join t2; Error: Error while compiling statement: FAILED: SemanticException [Error 10036]: Duplicate column name: id (state=42000,code=10036) {code} PS : create table t3(`t1.id` int, `t2.id` int); will fail for dot(.) in column name. was: create table t1(id int); create table t2(id int); create table t3 as select t1.id, t2.id from t1 join t2; CBO fails if "hive.stats.column.autogather=true" with "SemanticException Ambiguous column reference: id" & CTAS passes with following table schema {code:java} desc t3; +-----------+------------+----------+ | col_name | data_type | comment | +-----------+------------+----------+ | t1.id | int | | | t2.id | int | | +-----------+------------+----------+{code} create table t3(`t1.id` int, `t2.id` int); will fail for dot(.) in column name. > CTAS accepts column's with dot(.) if CBO fails > ---------------------------------------------- > > Key: HIVE-25118 > URL: https://issues.apache.org/jira/browse/HIVE-25118 > Project: Hive > Issue Type: Bug > Reporter: Naresh P R > Priority: Major > > create table t1(id int); > create table t2(id int); > create table t3 as select t1.id, t2.id from t1 join t2; > CBO fails if "hive.stats.column.autogather=true" with "SemanticException > Ambiguous column reference: id" & CTAS passes with following table schema > {code:java} > desc t3; > +-----------+------------+----------+ > | col_name | data_type | comment | > +-----------+------------+----------+ > | t1.id | int | | > | t2.id | int | | > +-----------+------------+----------+{code} > disabling column stats will fail the query > {code:java} > set hive.stats.column.autogather=false; > create table t3 as select t1.id, t2.id from t1 join t2; > Error: Error while compiling statement: FAILED: SemanticException [Error > 10036]: Duplicate column name: id (state=42000,code=10036) > {code} > PS : create table t3(`t1.id` int, `t2.id` int); will fail for dot(.) in > column name. -- This message was sent by Atlassian Jira (v8.3.4#803005)