You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by mufy <mu...@gmail.com> on 2014/11/09 07:07:30 UTC

Dropping Views Throws Unrelated Error

I created the following 2 views on 2 separate schemas.

0: jdbc:drill:zk=n67:5181> select * from INFORMATION_SCHEMA.`VIEWS`;
+---------------+--------------+------------+-----------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION |
+---------------+--------------+------------+-----------------+
| DRILL         | dfs.tmp      | case_customer | SELECT `columns`[0],
`columns`[1] FROM `dfs`.`root`.`cases.csv` |
| DRILL         | n64.tmp      | case_customer | SELECT `columns`[0],
`columns`[1] FROM `dfs`.`root`.`cases.csv` |
+---------------+--------------+------------+-----------------+
2 rows selected (0.121 seconds)

Now, being in 'n64.tmp' I drop the following schema. All good.

0: jdbc:drill:zk=n67:5181> drop view case_customer;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | View 'case_customer' deleted successfully from 'n64.tmp'
schema |
+------------+------------+
1 row selected (0.135 seconds)

0: jdbc:drill:zk=n67:5181> select * from INFORMATION_SCHEMA.`VIEWS`;
+---------------+--------------+------------+-----------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION |
+---------------+--------------+------------+-----------------+
| DRILL         | dfs.tmp      | case_customer | SELECT `columns`[0],
`columns`[1] FROM `dfs`.`root`.`cases.csv` |
+---------------+--------------+------------+-----------------+
1 row selected (0.145 seconds)

Now, when I try to drop again it should say something like "No view by the
name case_customer found in the current workspace." Rather it throws the
below.

0: jdbc:drill:zk=n67:5181> drop view case_customer;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| false      | Error: Failure while accessing Zookeeper |
+------------+------------+
1 row selected (0.126 seconds)


And all good as it should be when executed as below.

0: jdbc:drill:zk=n67:5181> drop view dfs.tmp.`case_customer`;
+------------+------------+
|     ok     |  summary   |
+------------+------------+
| true       | View 'case_customer' deleted successfully from 'dfs.tmp'
schema |
+------------+------------+
1 row selected (0.11 seconds)

0: jdbc:drill:zk=n67:5181> select * from INFORMATION_SCHEMA.`VIEWS`;
+---------------+--------------+------------+-----------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION |
+---------------+--------------+------------+-----------------+
+---------------+--------------+------------+-----------------+
No rows selected (0.136 seconds)


---
Mufeed Usman
My LinkedIn <http://www.linkedin.com/pub/mufeed-usman/28/254/400> | My
Social Cause <http://www.vision2016.org.in/> | My Blogs : LiveJournal
<http://mufeed.livejournal.com>

Re: Dropping Views Throws Unrelated Error

Posted by Jacques Nadeau <ja...@apache.org>.
Can you please file a JIRA requesting better messaging when attempting to
drop a non-existent view?

thanks,
Jacques

On Sat, Nov 8, 2014 at 10:07 PM, mufy <mu...@gmail.com> wrote:

> I created the following 2 views on 2 separate schemas.
>
> 0: jdbc:drill:zk=n67:5181> select * from INFORMATION_SCHEMA.`VIEWS`;
> +---------------+--------------+------------+-----------------+
> | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION |
> +---------------+--------------+------------+-----------------+
> | DRILL         | dfs.tmp      | case_customer | SELECT `columns`[0],
> `columns`[1] FROM `dfs`.`root`.`cases.csv` |
> | DRILL         | n64.tmp      | case_customer | SELECT `columns`[0],
> `columns`[1] FROM `dfs`.`root`.`cases.csv` |
> +---------------+--------------+------------+-----------------+
> 2 rows selected (0.121 seconds)
>
> Now, being in 'n64.tmp' I drop the following schema. All good.
>
> 0: jdbc:drill:zk=n67:5181> drop view case_customer;
> +------------+------------+
> |     ok     |  summary   |
> +------------+------------+
> | true       | View 'case_customer' deleted successfully from 'n64.tmp'
> schema |
> +------------+------------+
> 1 row selected (0.135 seconds)
>
> 0: jdbc:drill:zk=n67:5181> select * from INFORMATION_SCHEMA.`VIEWS`;
> +---------------+--------------+------------+-----------------+
> | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION |
> +---------------+--------------+------------+-----------------+
> | DRILL         | dfs.tmp      | case_customer | SELECT `columns`[0],
> `columns`[1] FROM `dfs`.`root`.`cases.csv` |
> +---------------+--------------+------------+-----------------+
> 1 row selected (0.145 seconds)
>
> Now, when I try to drop again it should say something like "No view by the
> name case_customer found in the current workspace." Rather it throws the
> below.
>
> 0: jdbc:drill:zk=n67:5181> drop view case_customer;
> +------------+------------+
> |     ok     |  summary   |
> +------------+------------+
> | false      | Error: Failure while accessing Zookeeper |
> +------------+------------+
> 1 row selected (0.126 seconds)
>
>
> And all good as it should be when executed as below.
>
> 0: jdbc:drill:zk=n67:5181> drop view dfs.tmp.`case_customer`;
> +------------+------------+
> |     ok     |  summary   |
> +------------+------------+
> | true       | View 'case_customer' deleted successfully from 'dfs.tmp'
> schema |
> +------------+------------+
> 1 row selected (0.11 seconds)
>
> 0: jdbc:drill:zk=n67:5181> select * from INFORMATION_SCHEMA.`VIEWS`;
> +---------------+--------------+------------+-----------------+
> | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION |
> +---------------+--------------+------------+-----------------+
> +---------------+--------------+------------+-----------------+
> No rows selected (0.136 seconds)
>
>
> ---
> Mufeed Usman
> My LinkedIn <http://www.linkedin.com/pub/mufeed-usman/28/254/400> | My
> Social Cause <http://www.vision2016.org.in/> | My Blogs : LiveJournal
> <http://mufeed.livejournal.com>
>