Skip to content

Commit

Permalink
Add some more error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Nov 28, 2024
1 parent 38cc21f commit 9016214
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/functions/table/create_property_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ unique_ptr<FunctionData> CreatePropertyGraphFunction::CreatePropertyGraphBind(

if (!table) {
throw Exception(ExceptionType::INVALID,
"Table " + vertex_table->schema_name + "." + vertex_table->table_name + " not found");
"Table " + vertex_table->catalog_name + "." + vertex_table->table_name + " not found");
}

CheckPropertyGraphTableColumns(vertex_table, *table);
Expand All @@ -190,6 +190,8 @@ unique_ptr<FunctionData> CreatePropertyGraphFunction::CreatePropertyGraphBind(
throw Exception(ExceptionType::INVALID, "Found a view with name " + vertex_table->table_name + ". Creating property graph tables over views is currently not supported.");
}
throw Exception(ExceptionType::INVALID, e.what());
} catch (BinderException &e) {
throw Exception(ExceptionType::INVALID, "Catalog '" + vertex_table->catalog_name + "' does not exist!");
}


Expand All @@ -207,7 +209,7 @@ unique_ptr<FunctionData> CreatePropertyGraphFunction::CreatePropertyGraphBind(
edge_table->table_name, OnEntryNotFound::RETURN_NULL);
if (!table) {
throw Exception(ExceptionType::INVALID,
"Table " + edge_table->schema_name + "." + edge_table->table_name + " not found");
"Table " + edge_table->catalog_name + "." + edge_table->table_name + " not found");
}

CheckPropertyGraphTableColumns(edge_table, *table);
Expand Down Expand Up @@ -246,6 +248,8 @@ unique_ptr<FunctionData> CreatePropertyGraphFunction::CreatePropertyGraphBind(
throw Exception(ExceptionType::INVALID, "Found a view with name " + edge_table->table_name + ". Creating property graph tables over views is currently not supported.");
}
throw Exception(ExceptionType::INVALID, e.what());
} catch (BinderException &e) {
throw Exception(ExceptionType::INVALID, "Catalog '" + edge_table->catalog_name + "' does not exist!");
}
}
return make_uniq<CreatePropertyGraphBindData>(info);
Expand Down
16 changes: 16 additions & 0 deletions test/sql/create_pg/attach_pg.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ select count(*) from bluesky.follows;
----
19566

statement error
-create or replace property graph stations vertex tables (stations.stations)
----
Invalid Error: Catalog 'stations' does not exist!

statement error
-create or replace property graph stations vertex tables (bluesky.account)
edge tables (nonexistingcatalog.follows source key (source) references bluesky.account (did)
destination key (destination) references bluesky.account (did))
----
Invalid Error: Catalog 'nonexistingcatalog' does not exist!

statement error
-create or replace property graph stations vertex tables (bluesky.tabledoesnotexist)
----
Invalid Error: Table bluesky.tabledoesnotexist not found

statement ok con1
-CREATE OR REPLACE PROPERTY GRAPH bluesky
Expand Down

0 comments on commit 9016214

Please sign in to comment.