nebula
nebula copied to clipboard
"...UNWIND [-808605814, (n4.L3.k19), (n9.L4.k21)] AS a3 RETURN a3" return different query results
Environment
Nebula Version: nightly Operating System: Ubuntu22.04 Installation Method: Docker API: Docker
Steps to Reproduce
- Create the graph database:log.txt
- Execute the following two queries:
- query1
MATCH (n4 :L1 :L2 :L3)
WITH n4
MATCH (n0)<-[]-(n1)<-[]-(n2 :L4)
MATCH (n3 :L3)<-[]-(n0)<-[]-(n3 :L2)
MATCH (n3 :L1 :L2)-[r4 :T0]->(n5 :L3)-[r5 :T2]->(n6), (n7 :L0)-[r6 :T5]->(n8 :L3)<-[r7 :T6]-(n9 :L3 :L4)
UNWIND [-808605814, (n4.L3.k19), (n9.L4.k21)] AS a3
RETURN a3
- query2
MATCH (n4 :L1 :L2 :L3)
WITH n4
MATCH (n0)<-[]-(n1)<-[]-(n2 :L4)
MATCH (n3:L3)<-[m2*1..1]-(n0)<-[m3*1..1]-(n3:L2) WHERE SIZE(m2)==1 AND SIZE(m3)==1 WITH n4, n2, n0, n1, n3
MATCH (n3 :L1 :L2)-[r4 :T0]->(n5 :L3)-[r5 :T2]->(n6),(n7 :L0)-[r6 :T5]->(n8 :L3)<-[r7 :T6]-(n9 :L3 :L4)
UNWIND [-808605814, (n4.L3.k19), (n9.L4.k21)] AS a3
RETURN a3
Expected Result
Both queries return the same result
Actual Result
The first query returns:
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| a3 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ("n13" :L3{k15: -1762334119, k16: -1098407295, k17: "kXxaf", k18: "cX", k19: -293665374} :L4{k20: "GjW", k21: 1833301028, k22: 273745573, k23: -1196683524, k24: -1057693161}) |
| ("n13" :L3{k15: -1762334119, k16: -1098407295, k17: "kXxaf", k18: "cX", k19: -293665374} :L4{k20: "GjW", k21: 1833301028, k22: 273745573, k23: -1196683524, k24: -1057693161}) |
| ("n13" :L3{k15: -1762334119, k16: -1098407295, k17: "kXxaf", k18: "cX", k19: -293665374} :L4{k20: "GjW", k21: 1833301028, k22: 273745573, k23: -1196683524, k24: -1057693161}) |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Got 3 rows (time spent 24.985ms/26.06947ms)
The second query returns:
+------------+
| a3 |
+------------+
| -808605814 |
| 1570485166 |
| 1833301028 |
+------------+
Got 3 rows (time spent 25.249ms/26.108164ms)
Issue Analysis
The key difference between the two queries lies in the path pattern matching and variable-length edge handling, which leads to different results when returning the results of UNWIND clause.
And a3 doesn't contain node but the first query returns.