-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix empty prop of tag and edge #505
Conversation
src/graph/test/DataTest.cpp
Outdated
} | ||
{ | ||
cpp2::ExecutionResponse resp; | ||
std::string cmd = "CREATE EDGE work()"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some cases:
- create edge e1(); create edge e2();
- create tag t1(); create e1();
- a very very long sentence /* or repeatly add 1000 times */
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. a very very long sentence /* or repeatly add 1000 times */
You inspired me, I have a few small questions:
- Is there a limit to the length of the SQL statement?
- Is there a limit on the number of tag/edge columns?
- Is there a limit to the length of each record when inserting vertex/edge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good! Add tests to cover this limits (and will not be changed by others in the future.)
src/graph/test/DataTest.cpp
Outdated
// Get result | ||
{ | ||
cpp2::ExecutionResponse resp; | ||
std::string cmd = "GO FROM 10001 OVER work yield $$company.name"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some case:
try to get a property which does not exist;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
cpp2::ExecutionResponse resp; | ||
std::string query = "DESCRIBE TAG not_exist"; | ||
std::string query = "CREATE EDGE edge1()"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add case:
alter edge1 without property to add a property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
close #453 |
src/graph/test/DataTest.cpp
Outdated
std::string cmd = "ADD HOSTS " + host; | ||
auto code = client_->execute(cmd, resp); | ||
if (cpp2::ErrorCode::SUCCEEDED != code) { | ||
return TestError() << "Do cmd:" << cmd << " failed"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about ”Execute cmd“ ?
close #436 |
Unit testing passed. |
any updates for this PR? @laura-ding Ready for review? |
@whitewum No anything to update, but should resolve conflicts. |
Unit testing passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Please add more tests as comment inline.
src/graph/test/OrderByTest.cpp
Outdated
@@ -61,7 +61,7 @@ TEST_F(OrderByTest, NoInput) { | |||
cpp2::ExecutionResponse resp; | |||
auto &player = players_["Nobody"]; | |||
auto *fmt = "GO FROM %ld OVER serve YIELD " | |||
"$^[player].name as name, serve.start_year as start, $$[team].name as name" | |||
"$^player.name as name, serve.start_year as start, $$team.name as name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
{ | ||
cpp2::ExecutionResponse resp; | ||
std::string query; | ||
for (auto i = 0u; i < 1000; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
auto code = client->execute(query, resp); | ||
ASSERT_EQ(cpp2::ErrorCode::SUCCEEDED, code); | ||
} | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's suppose tag100~tag101000 have been created.
then let's
- drop tag10100~tag10300.
- alter tag10400~tag10500
let's check the results. - -> not existed
- -> changed
- -> others, remain unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one.
But in my opinion, it would be better to adapt the syntax to like $$.tag_name.prop_name
(including $^
), which is more conform to other similar constructs such as $var
and $-
.
Unit testing passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -61,7 +61,7 @@ TEST_F(OrderByTest, NoInput) { | |||
cpp2::ExecutionResponse resp; | |||
auto &player = players_["Nobody"]; | |||
auto *fmt = "GO FROM %ld OVER serve YIELD " | |||
"$^player.name as name, serve.start_year as start, $$team.name as name" | |||
"$^.player.name as name, serve.start_year as start, $$.team.name as name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upper AS
Unit testing failed. |
Unit testing passed. |
* Fix typos * Add periodical license check and refactor License class interface * Change check interval to 12 hours * Remove unnecessary variable definition * Add exit routine in the periodically check * Fix license check in stand alone daemon * Raise signal to terminate the process gracefully
Delete [] of SRC_REF and DST_REF
Fix insert vertex and edge when tag or edge has the empty prop