Skip to content

Commit

Permalink
Add in expected error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Dec 9, 2022
1 parent 3fbc5c4 commit 6be3662
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions datafusion/core/tests/sqllogictests/test_files/ddl.slt
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ statement ok
DROP TABLE users;

# Table is gone
statement error
statement error Error during planning: table 'datafusion.public.users' not found
select * from users;

# Can not drop it again
statement error
statement error Table Bare \{ table: "user" \} doesn't exist.
DROP TABLE user;

# Can not insert into a undefined table
statement error
statement error No table named 'user'
insert into user values(1, 20);

##########
Expand All @@ -83,11 +83,11 @@ select * from "foo.bar";
2 3

# Can not select from non existent foo.bar table
statement error
statement error failed to resolve schema: foo
select * from foo.bar;

# Error if wrong capitalization to select
statement error
statement error table 'datafusion.public.Foo.bar' not found
select * from "Foo.bar";

# Should be able to drop the table
Expand Down Expand Up @@ -125,11 +125,11 @@ select * from "foo.bar";
2 3

# Can not select from non existent foo.bar view
statement error
statement error failed to resolve schema: foo
select * from foo.bar;

# Error if wrong capitalization to select
statement error
statement error table 'datafusion.public.Foo.bar' not found
select * from "Foo.bar";

# Should be able to drop the view
Expand Down Expand Up @@ -175,7 +175,7 @@ select * from "bar";
4 5

# multiple drops not supported
statement error
statement error Multiple objects not supported
DROP VIEW foo, bar;

# multiple drops not supported
Expand All @@ -187,15 +187,15 @@ statement ok
DROP VIEW bar;

# not ok to drop after already dropped
statement error
statement error View Bare \{ table: "bar" \} doesn't exist.
DROP VIEW bar;

# ok to drop with IF EXISTS after already dropped
statement ok
DROP VIEW IF EXISTS bar;

# can't drop non existent view
statement error
statement error View Bare \{ table: "non_existent_view" \} doesn't exist.
DROP VIEW non_existent_view

##########
Expand All @@ -218,15 +218,15 @@ statement ok
DROP TABLE my_table;

# not ok to drop after already dropped
statement error
statement error Table Bare \{ table: "my_table" \} doesn't exist.
DROP TABLE my_table;

# ok to drop after already dropped with IF EXISTS
statement ok
DROP TABLE IF EXISTS my_table;

# Can't drop non existent table
statement error
statement error Table Bare \{ table: "non_existent_table" \} doesn't exist.
DROP TABLE non_existent_table;


Expand All @@ -246,7 +246,7 @@ statement ok
DROP TABLE aggregate_simple

# create_table_with_schema_as_select_mismatch
statement error
statement error table 'datafusion.public.aggregate_simple' not found
CREATE TABLE my_table(c1 float, c2 double, c3 boolean, c4 varchar) AS SELECT * FROM aggregate_simple;


Expand Down Expand Up @@ -277,7 +277,8 @@ SELECT * FROM y
5 6

# 'IF NOT EXISTS' cannot coexist with 'REPLACE'
statement error
# TODO this shoudn't be an internal error
statement error Internal error: 'IF NOT EXISTS' cannot coexist with 'REPLACE'
CREATE OR REPLACE TABLE if not exists y AS VALUES (7,8);

statement ok
Expand All @@ -288,7 +289,7 @@ DROP TABLE y
statement ok
CREATE TABLE t AS SELECT 1

statement error
statement error View Bare \{ table: "t" \} doesn't exist.
DROP VIEW t

statement ok
Expand All @@ -298,7 +299,7 @@ DROP TABLE t
statement ok
CREATE VIEW v AS SELECT 1;

statement error
statement error Table Bare \{ table: "v" \} doesn't exist.
DROP TABLE v;

statement ok
Expand Down Expand Up @@ -381,7 +382,7 @@ DROP TABLE csv_with_timestamps
statement ok
CREATE TABLE y AS VALUES (1,2,3);

statement error
statement error Table 'Bare \{ table: "y" \}' already exists
CREATE TABLE y AS VALUES (1,2,3);

statement ok
Expand All @@ -392,7 +393,7 @@ DROP TABLE y;
statement ok
CREATE VIEW y AS VALUES (1,2,3);

statement error
statement error Table 'Bare \{ table: "y" \}' already exists
CREATE VIEW y AS VALUES (1,2,3);

statement ok
Expand Down

0 comments on commit 6be3662

Please sign in to comment.