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

Fix empty prop of tag and edge #505

Merged
merged 7 commits into from
Jul 9, 2019
Merged

Fix empty prop of tag and edge #505

merged 7 commits into from
Jul 9, 2019

Conversation

laura-ding
Copy link
Contributor

Delete [] of SRC_REF and DST_REF
Fix insert vertex and edge when tag or edge has the empty prop

@laura-ding laura-ding changed the title Fix empty prop Fix empty prop of tag and edge Jun 10, 2019
}
{
cpp2::ExecutionResponse resp;
std::string cmd = "CREATE EDGE work()";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add some cases:

  1. create edge e1(); create edge e2();
  2. create tag t1(); create e1();
  3. a very very long sentence /* or repeatly add 1000 times */

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@whitewum 👍

3. a very very long sentence /* or repeatly add 1000 times */

You inspired me, I have a few small questions:

  1. Is there a limit to the length of the SQL statement?
  2. Is there a limit on the number of tag/edge columns?
  3. Is there a limit to the length of each record when inserting vertex/edge?

Copy link
Contributor

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.)

// Get result
{
cpp2::ExecutionResponse resp;
std::string cmd = "GO FROM 10001 OVER work yield $$company.name";
Copy link
Contributor

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;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

whitewum
whitewum previously approved these changes Jun 11, 2019
cpp2::ExecutionResponse resp;
std::string query = "DESCRIBE TAG not_exist";
std::string query = "CREATE EDGE edge1()";
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

@laura-ding
Copy link
Contributor Author

close #453

std::string cmd = "ADD HOSTS " + host;
auto code = client_->execute(cmd, resp);
if (cpp2::ErrorCode::SUCCEEDED != code) {
return TestError() << "Do cmd:" << cmd << " failed";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about ”Execute cmd“ ?

@laura-ding laura-ding added the ready-for-testing PR: ready for the CI test label Jun 19, 2019
@laura-ding
Copy link
Contributor Author

close #436

@nebula-community-bot
Copy link
Member

Unit testing passed.

@whitewum
Copy link
Contributor

whitewum commented Jul 6, 2019

any updates for this PR? @laura-ding Ready for review?

@laura-ding
Copy link
Contributor Author

@whitewum No anything to update, but should resolve conflicts.

@nebula-community-bot
Copy link
Member

Unit testing passed.

whitewum
whitewum previously approved these changes Jul 8, 2019
Copy link
Contributor

@whitewum whitewum left a 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/common/filter/Expressions.cpp Outdated Show resolved Hide resolved
src/graph/test/OrderByTest.cpp Outdated Show resolved Hide resolved
@@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

src/graph/test/SchemaTest.cpp Show resolved Hide resolved
src/graph/test/SchemaTest.cpp Outdated Show resolved Hide resolved
{
cpp2::ExecutionResponse resp;
std::string query;
for (auto i = 0u; i < 1000; i++) {
Copy link
Contributor

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);
}
{
Copy link
Contributor

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

  1. drop tag10100~tag10300.
  2. alter tag10400~tag10500
    let's check the results.
  3. -> not existed
  4. -> changed
  5. -> others, remain unchanged.

Copy link
Contributor

@dutor dutor left a 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 $-.

@nebula-community-bot
Copy link
Member

Unit testing passed.

Copy link
Contributor

@dutor dutor left a 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upper AS

src/graph/test/SchemaTest.cpp Show resolved Hide resolved
@nebula-community-bot
Copy link
Member

Unit testing failed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dutor dutor merged commit 9d58989 into vesoft-inc:master Jul 9, 2019
@laura-ding laura-ding deleted the FixEmptyProp branch October 30, 2019 11:00
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Feb 16, 2020
)

* Support empty property

* Delete [] of SRC_REF and DST_REF
Add UTs

* Address whitewum's comment

* rebase upstream

* Address dutor's comment

* Fix toString()
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
)

* Support empty property

* Delete [] of SRC_REF and DST_REF
Add UTs

* Address whitewum's comment

* rebase upstream

* Address dutor's comment

* Fix toString()
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Mar 21, 2022
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants