[ 
https://issues.apache.org/jira/browse/HIVE-19770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16498684#comment-16498684
 ] 

Vineet Garg commented on HIVE-19770:
------------------------------------

Attached is first patch which provide CBO support for queries with multiple 
same column in select. Following are the known changes/effects: 

* Change in row schema: queries with multiple same column in select now has 
slightly different row scheme .e.g select c, c .. will have c, c_1 instead of 
c, c. I think this is probably because we losses the information about 
duplicate columns once calcite plan is rewritten to AST. This info is displayed 
in post hook of qtest and as far as I can tell it is a safe change.
* One query has different (worse) plan (it now has cbo + vectorization) and new 
plan for some reason contains extra reducer. The root cause for this has yet to 
be determined but this should not introduce correctness issues.
* Bunch of queries are missing lineage information (displayed in posthook). 
This is due to constant folding happening in CBO. e.g. insert into .... select 
a,b from t1 where b=1. column corresponding to B will have lineage info missing 
because reference to B is foled to 1. Not sure if this is acceptable/expected 
for lineage.


> 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
>
>
> 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)

Reply via email to