[ 
https://issues.apache.org/jira/browse/DRILL-1189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jinfeng Ni resolved DRILL-1189.
-------------------------------

    Resolution: Fixed

DRILL-1189 seems to be fixed. I tried the original view DDL and select * join 
query, it returned the expected rows:


create view myview as select n_nationkey, n_name, n_regionkey, n_comment from 
cp.`tpch/nation.parquet`;

select * from myview v join cp.`tpch/nation.parquet` n on v.n_nationkey = 
n.n_nationkey;

+-------------+------------+-------------+------------+--------------+------------+--------------+------------+
| n_nationkey |   n_name   | n_regionkey | n_comment  | n_nationkey0 |  n_name0 
  | n_regionkey0 | n_comment0 |
+-------------+------------+-------------+------------+--------------+------------+--------------+------------+
| 0           | ALGERIA    | 0           |  haggle. carefully final deposits 
detect slyly agai | 0            | ALGERIA    | 0            |  haggle. 
carefully final deposits detect slyly agai |
| 1           | ARGENTINA  | 1           | al foxes promise slyly according to 
the regular accounts. bold requests alon | 1            | ARGENTINA  | 1        
    | al foxes
....
25 rows selected (0.6 seconds)

> Return 0 row, when there is select * from view join another table,  and there 
> are duplicate column names.
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-1189
>                 URL: https://issues.apache.org/jira/browse/DRILL-1189
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Jinfeng Ni
>            Assignee: Jinfeng Ni
>             Fix For: 0.5.0
>
>
> If we create a view, and do a select * from view join another table T on 
> columns with identical names from the base table of view and from table T, 
> then Drill will incorrectly return 0 rows.
> create view myview as select n_nationkey, n_name, n_regionkey, n_comment from 
> cp.`tpch/nation.parquet`;
> // return 0 rows!   Because of column re-naming
> select * from myview v join cp.`tpch/nation.parquet` n on v.n_nationkey = 
> n.n_nationkey;   
>  



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to