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

multiple tag bug when has same name properties #2753

Closed
czpmango opened this issue Aug 30, 2021 · 9 comments
Closed

multiple tag bug when has same name properties #2753

czpmango opened this issue Aug 30, 2021 · 9 comments
Assignees
Labels
duplicate Solution: this issue or pull request already exists priority/low-pri Priority: low type/bug Type: something is unexpected

Comments

@czpmango
Copy link
Contributor

czpmango commented Aug 30, 2021

Multi-tag(Contains attributes of the same name) filtering leads to incorrect results.

This is my test:

(czp@nebula) [nba]> create space t2(vid_type=Fixed_string(30))
Execution succeeded (time spent 1812/2076 us)

(czp@nebula) [nba]> use t2
[ERROR (-1005)]: SpaceNotFound: 

(czp@nebula) [nba]> use t2
Execution succeeded (time spent 1900/2158 us)

(czp@nebula) [t2]> create tag person(name string)
Execution succeeded (time spent 1286/1526 us)

(czp@nebula) [t2]> create tag index p1 on person(name(3))
Execution succeeded (time spent 4182/4453 us)

(czp@nebula) [t2]> insert vertex person(name) values "1":("abc1")
Execution succeeded (time spent 1880/2109 us)

(czp@nebula) [t2]> insert vertex person(name) values "2":("abc2")
Execution succeeded (time spent 2007/2265 us)

(czp@nebula) [t2]> rebuild tag index p1
+------------+
| New Job Id |
+------------+
| 141        |
+------------+
Got 1 rows (time spent 1961/2292 us)

(czp@nebula) [t2]> show jobs
+--------+---------------------+------------+----------------------------+----------------------------+
| Job Id | Command             | Status     | Start Time                 | Stop Time                  |
+--------+---------------------+------------+----------------------------+----------------------------+
| 141    | "REBUILD_TAG_INDEX" | "FINISHED" | 2021-08-30T03:23:26.000000 | 2021-08-30T03:23:26.000000 |
+--------+---------------------+------------+----------------------------+----------------------------+
Got 1 rows (time spent 2046/2462 us)

(czp@nebula) [t2]> match (v:person) where v.name >= "abc" return v
+-----------------------------+
| v                           |
+-----------------------------+
| ("1" :person{name: "abc1"}) |
+-----------------------------+
| ("2" :person{name: "abc2"}) |
+-----------------------------+
Got 2 rows (time spent 7432/7804 us)

(czp@nebula) [t2]> create tag student(name string)
Execution succeeded (time spent 1742/2060 us)

(czp@nebula) [t2]> insert vertex student(name) values "1":("stu1")
Execution succeeded (time spent 2288/2620 us)

(czp@nebula) [t2]> insert vertex student(name) values "2":("stu2")
Execution succeeded (time spent 1682/1960 us)

(czp@nebula) [t2]> match (v:person) where v.name >= "abc" return v
+----------------------------------------------------+
| v                                                  |
+----------------------------------------------------+
| ("1" :student{name: "stu1"} :person{name: "abc1"}) |
+----------------------------------------------------+
| ("2" :student{name: "stu2"} :person{name: "abc2"}) |
+----------------------------------------------------+
Got 2 rows (time spent 7464/7881 us)

(czp@nebula) [t2]> profile match (v:person) where v.name=="abc" return v
+---+
| v |
+---+
+---+
Empty set (time spent 7427/7935 us)

(czp@nebula) [t2]> match (v:person) where v.name<="abc2" return v
+---+
| v |
+---+
+---+
Empty set (time spent 7728/8050 us)

(czp@nebula) [t2]> match (v:person) where v.name<="stu2" return v
+----------------------------------------------------+
| v                                                  |
+----------------------------------------------------+
| ("1" :student{name: "stu1"} :person{name: "abc1"}) |
+----------------------------------------------------+
| ("2" :student{name: "stu2"} :person{name: "abc2"}) |
+----------------------------------------------------+
Got 2 rows (time spent 7730/8172 us)

(czp@nebula) [t2]> match (v:person) where v.name<="stu1" return v
+----------------------------------------------------+
| v                                                  |
+----------------------------------------------------+
| ("1" :student{name: "stu1"} :person{name: "abc1"}) |
+----------------------------------------------------+
Got 1 rows (time spent 7255/7589 us)

@czpmango czpmango added type/bug Type: something is unexpected priority/low-pri Priority: low labels Aug 30, 2021
@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Aug 30, 2021

It's discussed before, user shouldn't have same name property if he want to use cypher query.

@czpmango
Copy link
Contributor Author

It's discussed before, user shouldn't have same name property if he want to use cypher query.

ACK.

@wey-gu
Copy link
Contributor

wey-gu commented Aug 31, 2021

similar to #2632

user shouldn't have same name property if he want to use cypher query.

@whitewum shall we highlight this somewhere, please? And do we need to modify the basketballplayer dataset to avoid "name" being defined in both tags?

@Shylock-Hg Shylock-Hg changed the title multiple tag bug multiple tag bug when has same name properties Aug 31, 2021
@Shylock-Hg
Copy link
Contributor

@vesoft-inc/graph-reviewers Shall we provide option to disable the same name properties?

@Shylock-Hg Shylock-Hg reopened this Aug 31, 2021
@whitewum
Copy link
Contributor

discussed with whom?

@whitewum
Copy link
Contributor

similar to #2632

user shouldn't have same name property if he want to use cypher query.

@whitewum shall we highlight this somewhere, please? And do we need to modify the basketballplayer dataset to avoid "name" being defined in both tags?

No. I think the bug should be fixed instead of being walked around.

@whitewum
Copy link
Contributor

@forest-yuxl

@Sophie-Xie Sophie-Xie added the duplicate Solution: this issue or pull request already exists label Aug 31, 2021
@Sophie-Xie
Copy link
Contributor

similar to #2632

user shouldn't have same name property if he want to use cypher query.

@whitewum shall we highlight this somewhere, please? And do we need to modify the basketballplayer dataset to avoid "name" being defined in both tags?

No. I think the bug should be fixed instead of being walked around.

@yixinglu pls confirm the solution of the other duplicate issue.

@yixinglu
Copy link
Contributor

yixinglu commented Sep 10, 2021

Will fix this issue by the #2659 feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Solution: this issue or pull request already exists priority/low-pri Priority: low type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

7 participants