[ https://issues.apache.org/jira/browse/HIVE-5817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13832232#comment-13832232 ]
Ashutosh Chauhan commented on HIVE-5817: ---------------------------------------- We should add following .q file in patch: {code} set hive.auto.convert.join=true; create table store(s_store_sk int, s_city string) stored as orc; insert overwrite table store select cint, cstring1 from alltypesorc where cint not in ( -3728, -563, 762, 6981, 253665376, 528534767, 626923679); create table store_sales(ss_store_sk int, ss_hdemo_sk int, ss_net_profit double) stored as orc; insert overwrite table store_sales select cint, cint, cdouble from alltypesorc where cint not in ( -3728, -563, 762, 6981, 253665376, 528534767, 626923679); create table household_demographics(hd_demo_sk int) stored as orc; insert overwrite table household_demographics select cint from alltypesorc where cint not in ( -3728, -563, 762, 6981, 253665376, 528534767, 626923679); set hive.vectorized.execution.enabled = true; select store.s_city, ss_net_profit from store_sales JOIN store ON store_sales.ss_store_sk = store.s_store_sk JOIN household_demographics ON store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk ; set hive.auto.convert.join=false; set hive.vectorized.execution.enabled = false; {code} I tested the patch on above query and output returned are correct. > column name to index mapping in VectorizationContext is broken > -------------------------------------------------------------- > > Key: HIVE-5817 > URL: https://issues.apache.org/jira/browse/HIVE-5817 > Project: Hive > Issue Type: Bug > Components: Vectorization > Reporter: Sergey Shelukhin > Assignee: Remus Rusanu > Priority: Critical > Attachments: HIVE-5817-uniquecols.broken.patch, > HIVE-5817.00-broken.patch, HIVE-5817.4.patch > > > Columns coming from different operators may have the same internal names > ("_colNN"). There exists a query in the form {{select b.cb, a.ca from a JOIN > b ON ... JOIN x ON ...;}} (distilled from a more complex query), which runs > ok w/o vectorization. With vectorization, it will run ok for most ca, but for > some ca it will fail (or can probably return incorrect results). That is > because when building column-to-VRG-index map in VectorizationContext, > internal column name for ca that the first map join operator adds to the > mapping may be the same as internal name for cb that the 2nd one tries to > add. 2nd VMJ doesn't add it (see code in ctor), and when it's time for it to > output stuff, it retrieves wrong index from the map by name, and then wrong > vector from VRG. -- This message was sent by Atlassian JIRA (v6.1#6144)