drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhishek Girish (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-2422) Querying views having the same name as their datasource fails
Date Thu, 23 Apr 2015 00:05:38 GMT

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

Abhishek Girish updated DRILL-2422:
-----------------------------------
    Description: 
Git.Commit.ID: f658a3c (Mar 9 2015)

*Convert a simple text file to Parquet:*
{code:sql}
> select * from `abc.dat` limit 1;
+------------+
|  columns   |
+------------+
| ["hi","abc"] |
+------------+
1 row selected (0.574 seconds)

> create table abc_1 as select cast(columns[0] as varchar(10)) as a from `abc.dat`;
+------------+---------------------------+
|  Fragment  | Number of records written |
+------------+---------------------------+
| 0_0        | 1                         |
+------------+---------------------------+
1 row selected (0.626 seconds)

> select * from abc_1 limit 1;
+------------+
|     a      |
+------------+
| hi         |
+------------+
1 row selected (0.135 seconds)
{code}

*Create a view on top of the Parquet table:*
{code:sql}
> create view abc_1 as select cast(a as varchar(10)) as b from abc_1;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
+------------+------------+
1 row selected (0.072 seconds)

> select * from abc_1 limit 1;
Query failed: SqlValidatorException: Column 'a' not found in any table
Error: exception while executing query: Failure while executing query. (state=,code=0)

OR 

> create view abc_1 as select cast(a as varchar(10)) as b from dfs.`/tmp/abc_1`;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
+------------+------------+
1 row selected (0.047 seconds)

> select * from abc_1 limit 1;
Query failed: SqlValidatorException: Column 'a' not found in any table
Error: exception while executing query: Failure while executing query. (state=,code=0)

OR 

> create view abc_1 as select a from dfs.`/tmp/abc_1`;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
+------------+------------+
1 row selected (0.046 seconds)

> select * from abc_1 limit 1;
+--+
|  |
+--+
+--+
No rows selected (11.856 seconds)
{code}
In the third case, queries do not return and need to be cancelled. 

For example:
{code:sql}
> use dfs.tpcds1;
+--+
|  |
+--+
+--+
No rows selected (2.854 seconds)
{code}
Sqlline needs to be suspended, killed and restarted to be able to query again. 





  was:
Git.Commit.ID: f658a3c (Mar 9 2015)

*Convert a simply text file to Parquet:*
{code:sql}
> select * from `abc.dat` limit 1;
+------------+
|  columns   |
+------------+
| ["hi","abc"] |
+------------+
1 row selected (0.574 seconds)

> create table abc_1 as select cast(columns[0] as varchar(10)) as a from `abc.dat`;
+------------+---------------------------+
|  Fragment  | Number of records written |
+------------+---------------------------+
| 0_0        | 1                         |
+------------+---------------------------+
1 row selected (0.626 seconds)

> select * from abc_1 limit 1;
+------------+
|     a      |
+------------+
| hi         |
+------------+
1 row selected (0.135 seconds)
{code}

*Create a view on top of the Parquet table:*
{code:sql}
> create view abc_1 as select cast(a as varchar(10)) as b from abc_1;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
+------------+------------+
1 row selected (0.072 seconds)

> select * from abc_1 limit 1;
Query failed: SqlValidatorException: Column 'a' not found in any table
Error: exception while executing query: Failure while executing query. (state=,code=0)

OR 

> create view abc_1 as select cast(a as varchar(10)) as b from dfs.`/tmp/abc_1`;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
+------------+------------+
1 row selected (0.047 seconds)

> select * from abc_1 limit 1;
Query failed: SqlValidatorException: Column 'a' not found in any table
Error: exception while executing query: Failure while executing query. (state=,code=0)

OR 

> create view abc_1 as select a from dfs.`/tmp/abc_1`;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
+------------+------------+
1 row selected (0.046 seconds)

> select * from abc_1 limit 1;
+--+
|  |
+--+
+--+
No rows selected (11.856 seconds)
{code}
In the third case, queries do not return and need to be cancelled. 

For example:
{code:sql}
> use dfs.tpcds1;
+--+
|  |
+--+
+--+
No rows selected (2.854 seconds)
{code}
Sqlline needs to be suspended, killed and restarted to be able to query again. 






> Querying views having the same name as their datasource fails
> -------------------------------------------------------------
>
>                 Key: DRILL-2422
>                 URL: https://issues.apache.org/jira/browse/DRILL-2422
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 0.8.0
>            Reporter: Abhishek Girish
>            Assignee: Venki Korukanti
>            Priority: Critical
>             Fix For: 0.9.0
>
>         Attachments: DRILL-2422-1.patch, drillbit_views.log
>
>
> Git.Commit.ID: f658a3c (Mar 9 2015)
> *Convert a simple text file to Parquet:*
> {code:sql}
> > select * from `abc.dat` limit 1;
> +------------+
> |  columns   |
> +------------+
> | ["hi","abc"] |
> +------------+
> 1 row selected (0.574 seconds)
> > create table abc_1 as select cast(columns[0] as varchar(10)) as a from `abc.dat`;
> +------------+---------------------------+
> |  Fragment  | Number of records written |
> +------------+---------------------------+
> | 0_0        | 1                         |
> +------------+---------------------------+
> 1 row selected (0.626 seconds)
> > select * from abc_1 limit 1;
> +------------+
> |     a      |
> +------------+
> | hi         |
> +------------+
> 1 row selected (0.135 seconds)
> {code}
> *Create a view on top of the Parquet table:*
> {code:sql}
> > create view abc_1 as select cast(a as varchar(10)) as b from abc_1;
> +------------+------------+
> |     ok     |  summary   |
> +------------+------------+
> | true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
> +------------+------------+
> 1 row selected (0.072 seconds)
> > select * from abc_1 limit 1;
> Query failed: SqlValidatorException: Column 'a' not found in any table
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> OR 
> > create view abc_1 as select cast(a as varchar(10)) as b from dfs.`/tmp/abc_1`;
> +------------+------------+
> |     ok     |  summary   |
> +------------+------------+
> | true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
> +------------+------------+
> 1 row selected (0.047 seconds)
> > select * from abc_1 limit 1;
> Query failed: SqlValidatorException: Column 'a' not found in any table
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> OR 
> > create view abc_1 as select a from dfs.`/tmp/abc_1`;
> +------------+------------+
> |     ok     |  summary   |
> +------------+------------+
> | true       | View 'abc_1' created successfully in 'dfs.tmp' schema |
> +------------+------------+
> 1 row selected (0.046 seconds)
> > select * from abc_1 limit 1;
> +--+
> |  |
> +--+
> +--+
> No rows selected (11.856 seconds)
> {code}
> In the third case, queries do not return and need to be cancelled. 
> For example:
> {code:sql}
> > use dfs.tpcds1;
> +--+
> |  |
> +--+
> +--+
> No rows selected (2.854 seconds)
> {code}
> Sqlline needs to be suspended, killed and restarted to be able to query again. 



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

Mime
View raw message