[ https://issues.apache.org/jira/browse/HIVE-19770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16551271#comment-16551271 ]
Vineet Garg commented on HIVE-19770: ------------------------------------ Earlier patch removed the same column restriction from CBO path and added ambiguity check (same as non-cbo path). But it turns out that ambiguity check is too restrictive e.g. queries like {code:sql} select count(*) from (select key, key from src) subq {code} is not allowed with this check. There are also queries which were successfully planned by CBO but now with this check are not allowed e.g. {code:sql} select count(*) from (select t1.key, t2.key from src t1 inner join src t2 on t1.key=t2.key)subq {code} Therefore I have removed the ambiguity check for now and opened HIVE-20215 for fix this. Fixing this will require checking ambiguity during column reference instead of generating column list for select. > Support for CBO for queries with multiple same columns in select > ---------------------------------------------------------------- > > Key: HIVE-19770 > URL: https://issues.apache.org/jira/browse/HIVE-19770 > Project: Hive > Issue Type: Improvement > Reporter: Vineet Garg > Assignee: Vineet Garg > Priority: Major > Attachments: HIVE-19770.1.patch, HIVE-19770.2.patch, > HIVE-19770.3.patch, HIVE-19770.4.patch, HIVE-19770.5.patch, HIVE-19770.6.patch > > > Currently queries such as {code:sql} select a,a from t1 where b > 10 {code} > are not supported for CBO. -- This message was sent by Atlassian JIRA (v7.6.3#76005)