The Wayback Machine - https://web.archive.org/web/20211024165431/https://github.com/trinodb/trino/issues/9129
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DROP TABLE IF EXISTS silently ignores views #9129

Open
findepi opened this issue Sep 6, 2021 · 5 comments
Open

DROP TABLE IF EXISTS silently ignores views #9129

findepi opened this issue Sep 6, 2021 · 5 comments

Comments

@findepi
Copy link
Member

@findepi findepi commented Sep 6, 2021

With Hive connector

trino:default> CREATE TABLE one (a varchar);
            -> CREATE VIEW two AS SELECT * FROM one;
CREATE TABLE
CREATE VIEW

DROP TABLE is rejected on a view:

trino:default> DROP TABLE two;
Query 20210906_150832_00015_id3y3 failed: line 1:1: Table 'hive.default.two' does not exist, but a view with that name exists. Did you mean DROP VIEW hive.default.two?

Now this should fail informing that relation indeed exists, but is not a table -- but succeeds:

trino:default> DROP TABLE IF EXISTS two;
DROP TABLE

nothing got dropped:

trino:default> SELECT * FROM two;
 a
---
(0 rows)
@ronnuriel
Copy link

@ronnuriel ronnuriel commented Sep 12, 2021

can you assign me to this issue ?

@ronnuriel
Copy link

@ronnuriel ronnuriel commented Sep 17, 2021

i have installed hadoop and hive ,
how can i get data for testing hive and configurations ?

@sopel39
Copy link
Member

@sopel39 sopel39 commented Sep 17, 2021

how can i get data for testing hive and configurations ?

You need to create view and then use DROP TABLE IF EXIST on that view

@ronnuriel
Copy link

@ronnuriel ronnuriel commented Sep 17, 2021

how can i get data for testing hive and configurations ?

You need to create view and then use DROP TABLE IF EXIST on that view

How do i create a view im new

@sopel39
Copy link
Member

@sopel39 sopel39 commented Sep 17, 2021

Please refer to Trino documentation: https://trino.io/docs/current/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants