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

Bug: IN clause does not find a node #4042

Closed
Claus1 opened this issue Aug 7, 2024 · 1 comment · Fixed by #4044
Closed

Bug: IN clause does not find a node #4042

Claus1 opened this issue Aug 7, 2024 · 1 comment · Fixed by #4044
Labels
bug Something isn't working

Comments

@Claus1
Copy link

Claus1 commented Aug 7, 2024

Kùzu version

0.4.2, 0.5.0

What operating system are you using?

Ubuntu 22

What happened?

I modified a Your First Graph example by adding ID property and making it as primary key.
in a query

   MATCH (a:User)-[r:LivesIn]->(b:City)
    WHERE b.ID in [1]
    RETURN a.*;

kuzu returns empty result, but

    MATCH (a:User)-[r:LivesIn]->(b:City)
    WHERE b.ID = 1
    RETURN a.*;

return the correct node.

Are there known steps to reproduce?

Code for reproducing:

import kuzu

# Initialize database
db = kuzu.Database("db")
conn = kuzu.Connection(db)

# Create schema
conn.execute("CREATE NODE TABLE User(name STRING, age INT64, ID SERIAL, PRIMARY KEY (ID))")
conn.execute("CREATE NODE TABLE City(name STRING, population INT64, ID SERIAL, PRIMARY KEY (ID))")    
conn.execute("CREATE REL TABLE LivesIn(FROM User TO City)")

# Insert data
conn.execute('COPY User FROM "./user.csv"')
conn.execute('COPY City FROM "./city.csv"')    

conn.execute(f"""
        MATCH (a:User), (b:City)
        WHERE a.ID = 1 AND b.ID = 1
        CREATE (a)-[r:LivesIn]->(b)            
        RETURN r.*
        """)

# Execute Cypher query
response = conn.execute(
    """
    MATCH (a:User)-[r:LivesIn]->(b:City)
    WHERE b.ID = 1
    RETURN a.*;
    """
)
while response.has_next():
    print(response.get_next())

response = conn.execute(
    """
    MATCH (a:User)-[r:LivesIn]->(b:City)
    WHERE b.ID in [1]
    RETURN a.*;
    """
)
while response.has_next():
    print(response.get_next())
@Claus1 Claus1 added the bug Something isn't working label Aug 7, 2024
@andyfengHKU
Copy link
Contributor

Hi @Claus1,

thanks for the report. This should be fixed in #4044. It will be available in our nightly build tmr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants