Skip to content

Commit

Permalink
Enable remaining types in rel table
Browse files Browse the repository at this point in the history
Fixes #2184
  • Loading branch information
benjaminwinger committed Dec 14, 2023
1 parent 1a33e48 commit 8783a6a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
7 changes: 0 additions & 7 deletions src/binder/bind/bind_ddl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ std::unique_ptr<BoundCreateTableInfo> Binder::bindCreateNodeTableInfo(const Crea

std::unique_ptr<BoundCreateTableInfo> Binder::bindCreateRelTableInfo(const CreateTableInfo* info) {
auto boundProperties = bindProperties(info->propertyNameDataTypes);
for (auto& boundProperty : boundProperties) {
if (boundProperty->getDataType()->getLogicalTypeID() == LogicalTypeID::SERIAL ||
boundProperty->getDataType()->getLogicalTypeID() == LogicalTypeID::MAP) {
throw BinderException(stringFormat("{} property is not supported in rel table.",
boundProperty->getDataType()->toString()));
}
}
auto extraInfo = (ExtraCreateRelTableInfo*)info->extraInfo.get();
auto srcMultiplicity = RelMultiplicityUtils::getFwd(extraInfo->relMultiplicity);
auto dstMultiplicity = RelMultiplicityUtils::getBwd(extraInfo->relMultiplicity);
Expand Down
5 changes: 0 additions & 5 deletions test/test_files/exceptions/binder/binder_error.test
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,6 @@ Binder exception: Serial property in node table must be the primary key.
---- error
Binder exception: Serial property in node table must be the primary key.

-LOG SerialInRelTable
-STATEMENT CREATE REL TABLE test(FROM person TO person, seq SERIAL)
---- error
Binder exception: SERIAL property is not supported in rel table.

-LOG MatchBuiltIn
-STATEMENT MATCH (a:person) RETURN a.age + 'hh'
---- error
Expand Down
14 changes: 9 additions & 5 deletions test/test_files/issue/issue.test
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@
-STATEMENT CREATE NODE TABLE T2(name STRING, myprops MAP(STRING,STRING), PRIMARY KEY(name));
---- ok
-STATEMENT CREATE REL TABLE KIND_OF3(FROM T TO T, myprops MAP(STRING,STRING));
---- error
Binder exception: MAP(STRING: STRING) property is not supported in rel table.
-STATEMENT CREATE REL TABLE KIND_OF3(FROM T TO T, myprops SERIAL);
---- error
Binder exception: SERIAL property is not supported in rel table.
---- ok
-STATEMENT CREATE REL TABLE KIND_OF4(FROM T TO T, myprops SERIAL);
---- ok
-STATEMENT CREATE (:T {name: "Foo"});
---- ok
-STATEMENT CREATE (:T {name: "Bar"});
---- ok
-STATEMENT MATCH (t1:T), (t2:T) where t1.name = 'Foo' AND t2.name = "Bar" CREATE (t1)-[:KIND_OF3 {myprops: map(['1', '2'], ['a', 'b'])}]->(t2);
---- ok

-CASE 2293
-STATEMENT CREATE NODE TABLE T(id INT64, PRIMARY KEY(id));
Expand Down
4 changes: 4 additions & 0 deletions test/test_files/update_rel/create_read_tinysnb.test
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@
2021-06-30
2021-06-30
2021-06-30

-LOG SerialInRelTable
-STATEMENT CREATE REL TABLE test(FROM person TO person, seq SERIAL)
---- ok

0 comments on commit 8783a6a

Please sign in to comment.