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

(:A)-[:r]->(:B) ≠ (:A)-[:r*1..1]->(:B) #3262

Closed
phf-1 opened this issue Apr 12, 2024 · 3 comments
Closed

(:A)-[:r]->(:B) ≠ (:A)-[:r*1..1]->(:B) #3262

phf-1 opened this issue Apr 12, 2024 · 3 comments

Comments

@phf-1
Copy link
Contributor

phf-1 commented Apr 12, 2024

Hello,

Thank you for your great work.
While testing Kuzu, I found that: (:A)-[:r]->(:B) ≠ (:A)-[:r*1..1]->(:B)
Is it supposed to be the case?

Cheers,
PHF


Here is a way to reproduce this observation, modulo a few renamings:

import kuzu
import shutil

tmpdir = "/tmp/kuzu_test"
shutil.rmtree(tmpdir)
db = kuzu.Database(tmpdir)
conn = kuzu.Connection(db)
queries = [
    'CREATE NODE TABLE Exercise (xxx String, PRIMARY KEY (xxx));',
    'CREATE REL TABLE next (FROM Exercise TO Exercise, xxx String);',
    'CREATE NODE TABLE Source (xxx String, PRIMARY KEY (xxx));',
    'CREATE NODE TABLE User (xxx String, PRIMARY KEY (xxx));',
    'CREATE REL TABLE GROUP has (FROM User TO Source, FROM Source TO Exercise, xxx String);',
    'CREATE (ex:Exercise {xxx: "11-ex"});',
    'CREATE (ex:Exercise {xxx: "12-ex"});',
    'CREATE (ex:Exercise {xxx: "13-ex"});',
    'MATCH (ex1:Exercise {xxx: "11-ex"}), (ex2:Exercise {xxx: "12-ex"}) CREATE (ex1)-[:next {xxx: "next"}]->(ex2);',
    'MATCH (ex1:Exercise {xxx: "12-ex"}), (ex2:Exercise {xxx: "13-ex"}) CREATE (ex1)-[:next {xxx: "next"}]->(ex2);',
    'CREATE (src:Source {xxx: "1-src"});',
    'MATCH (src:Source {xxx: "1-src"}), (ex:Exercise {xxx: "11-ex"}) CREATE (src)-[:has {xxx: "has"}]->(ex);',
    'MATCH (src:Source {xxx: "1-src"}), (ex:Exercise {xxx: "12-ex"}) CREATE (src)-[:has {xxx: "has"}]->(ex);',
    'MATCH (src:Source {xxx: "1-src"}), (ex:Exercise {xxx: "13-ex"}) CREATE (src)-[:has {xxx: "has"}]->(ex);',
    'CREATE (usr:User {xxx: "usr"});',
    'MATCH (usr:User {xxx: "usr"}), (src:Source {xxx: "1-src"}) CREATE (usr)-[:has {xxx: "has"}]->(src);',
    'CREATE (ex:Exercise {xxx: "21-ex"});',
    'CREATE (ex:Exercise {xxx: "22-ex"});',
    'MATCH (ex1:Exercise {xxx: "21-ex"}), (ex2:Exercise {xxx: "22-ex"}) CREATE (ex1)-[:next {xxx: "next"}]->(ex2);',
    'CREATE (src:Source {xxx: "2-src"});',
    'MATCH (src:Source {xxx: "2-src"}), (ex:Exercise {xxx: "21-ex"}) CREATE (src)-[:has {xxx: "has"}]->(ex);',
    'MATCH (src:Source {xxx: "2-src"}), (ex:Exercise {xxx: "22-ex"}) CREATE (src)-[:has {xxx: "has"}]->(ex);',
    'MATCH (usr:User {xxx: "usr"}), (src:Source {xxx: "2-src"}) CREATE (usr)-[:has {xxx: "has"}]->(src);',
]

for query in queries:
    conn.execute(query, {})

Screenshot from 2024-04-12 10-48-13
Screenshot from 2024-04-12 10-48-39

@prrao87
Copy link
Member

prrao87 commented Apr 12, 2024

This seems related to #3169 and #3166

@andyfengHKU
Copy link
Contributor

@phf-1 thanks for reporting. I'll take a look.

@andyfengHKU
Copy link
Contributor

Hi @phf-1 this should be fixed in PR #3384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants