[ https://issues.apache.org/jira/browse/DRILL-2830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14741461#comment-14741461 ]
Victoria Markman commented on DRILL-2830: ----------------------------------------- I'm removing fix version from this bug, since this bug is marked as a duplicate of a bug that has not been fixed yet. So DRILL-2345 will have target fix version set. > Self-Join via view gives wrong results > -------------------------------------- > > Key: DRILL-2830 > URL: https://issues.apache.org/jira/browse/DRILL-2830 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Reporter: Sean Hsuan-Yi Chu > Assignee: Sean Hsuan-Yi Chu > Priority: Critical > > Create a view by: > {code} > create view v1(x, y) as select n_regionkey, n_nationkey from > cp.`tpch/nation.parquet`; > {code} > And join this view with the file which created the view with condition > t.n_nationkey = v1.y (where 'y' is n_nationkey) > {code} > select t.n_nationkey from cp.`tpch/nation.parquet` t inner join v1 on > t.n_nationkey = v1.y; > +-------------+ > | n_nationkey | > +-------------+ > | 0 | > | 1 | > | 1 | > | 1 | > | 4 | > | 0 | > | 3 | > | 3 | > | 2 | > | 2 | > | 4 | > | 4 | > | 2 | > | 4 | > | 0 | > | 0 | > | 0 | > | 1 | > | 2 | > | 3 | > | 4 | > | 2 | > | 3 | > | 3 | > | 1 | > +-------------+ > 25 rows selected (0.153 seconds) > {code} > After investigating the plan, I found out that the result was produced as if > the join condition was t.n_nationkey = v1.x (where x is 'n_regionkey') -- This message was sent by Atlassian JIRA (v6.3.4#6332)