kuzu icon indicating copy to clipboard operation
kuzu copied to clipboard

Bug: CLI parsing with unicode strings is erratic

Open prrao87 opened this issue 6 months ago • 0 comments

Kùzu version

0.5.0

What operating system are you using?

macOS

What happened?

I'm noticing this inconsistent parsing behaviour between the CLI and the Python API when working with a table that has non-English characters.

CLI doesn't work

First, I create a node table for books in German:

CREATE NODE TABLE IF NOT EXISTS `B\u00fccher` (title STRING, price INT64, PRIMARY KEY (title));

Then I add a German book, referencing the table name with escaped characters

CREATE (n:`B\u00fccher` {title: 'Der Thron der Sieben Königreiche'}) SET n.price = 20;

Then I try to run a match query that directly references the table name via its unicode form, Bücher.

MATCH (n:Bücher) RETURN label(n);

I get this error:

Error: Binder exception: Table Bücher does not exist.

Python works

The same workflow when run in Python works.

import kuzu
import shutil

shutil.rmtree("test_db", ignore_errors=True)
db = kuzu.Database("test_db")
conn = kuzu.Connection(db)

# create a table
conn.execute("CREATE NODE TABLE IF NOT EXISTS `B\u00fccher` (title STRING, price INT64, PRIMARY KEY (title))")

# insert some data
conn.execute("CREATE (n:`B\u00fccher` {title: 'Der Thron der Sieben Königreiche'}) SET n.price = 20")

# Check values
res = conn.execute("MATCH (n:Bücher) RETURN label(n)")
while res.has_next():
    print(res.get_next())
['Bücher']

Are there known steps to reproduce?

See above.

prrao87 avatar Aug 13 '24 16:08 prrao87