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

Rahul Challapalli commented on DRILL-3227:
------------------------------------------

Even when the view is created from the available columns from the data file, we 
do encounter this exception
{code}
create or replace view v1(x,y) as select c1, c2 from `a.json`;
+-------+-----------------------------------------------------------------------+
|  ok   |                                summary                                
|
+-------+-----------------------------------------------------------------------+
| true  | View 'v2830' replaced successfully in 'dfs.drillTestDirViews' schema  
|
+-------+-----------------------------------------------------------------------+
1 row selected (0.13 seconds)

select a.c1 from `a.json` a inner join v2830 on a.c1 = v2830.x;
Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
Unexpected exception during fragment initialization: null


[Error Id: f5e6c2e8-5be3-42bb-bbed-56f717d8a997 on qa-node191.qa.lab:31010] 
(state=,code=0)
{code}

Ironically the below query works and give wrong results. This is DRILL-2830
{code}
select a.c1 from `a.json` a inner join v2830 on a.c1 = v2830.y;
+-----+
| c1  |
+-----+
| 1   |
+-----+
1 row selected (0.253 seconds)
{code}

> Planning Error : Self join between a view and underlying file fails to plan 
> when the view contains missing columns
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-3227
>                 URL: https://issues.apache.org/jira/browse/DRILL-3227
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Rahul Challapalli
>            Assignee: Jinfeng Ni
>         Attachments: error.log
>
>
> git.commit.id.abbrev=6f54223
> The below view is created with non-existent columns
> {code}
> create or replace view v1(x,y) as select col1, col2 from `a.json`;
> +-------+-------------------------------------------------------------------+
> |  ok   |                              summary                              |
> +-------+-------------------------------------------------------------------+
> | true  | View 'v1' created successfully in 'dfs.drillTestDirViews' schema  |
> +-------+-------------------------------------------------------------------+
> 1 row selected (0.142 seconds)
> 0: jdbc:drill:schema=dfs_eea> select * from v1;
> +-------+-------+
> |   x   |   y   |
> +-------+-------+
> | null  | null  |
> +-------+-------+
> 1 row selected (0.129 seconds)
> {code}
> Now when I try to join the view with the underlying file, I get a planning 
> error
> {code}
> 0: jdbc:drill:schema=dfs_eea> select c1 from `a.json` a inner join v1 on a.c1 
> = v1.x;
> Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
> Unexpected exception during fragment initialization: null
> [Error Id: d38b4e61-d56f-4cd6-97dd-787deaebd33f on qa-node191.qa.lab:31010] 
> (state=,code=0)
> explain plan for select c1 from `a.json` a inner join v1 on a.c1 = v1.x;
> Error: SYSTEM ERROR: org.apache.drill.exec.work.foreman.ForemanException: 
> Unexpected exception during fragment initialization: null
> [Error Id: af10a933-ddf2-4bca-94a7-7b0383c9a1d4 on qa-node191.qa.lab:31010] 
> (state=,code=0)
> {code}
> I attached the data and the error log



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to