Mayil-AI-Sandbox / kuzudb_jan15

MIT License
0 stars 0 forks source link

Inconsistent behavior for binder error (hashtag2804) #22

Open vikramsubramanian opened 4 months ago

vikramsubramanian commented 4 months ago

I have an RDFGraph named wklx. I am running the following query:

match (s:wklx_r)-[p:wklx_rt]->(o) return s.iri, p.iri, o.iri, o.val limit 10;

This does not give a binding error and instead prints a val column with null values. I was expecting it because o can only be of type wklx_r and that does not have val property. If I specify the type, then I get a binding error.

match (s:wklx_r)-[p:wklx_rt]->(o:wklx_r) return s.iri, p.iri, o.iri, o.val limit 10;
Error: Binder exception: Cannot find property val for o.

It's not clear if we should give a binder error or but I think a smart system would by resolving the possible types first. My bigger worry is that if we are not doing such type resolutions, we might end up doing unnecessary joins (e.g., by scanning both wklx_r and wklx_l tables to bind to o). That is I can imagine not doing type resolutions correctly can decrease performance significantly in some cases. )

mayil-ai[bot] commented 4 months ago

Summary: Inconsistent behavior with binding error for RDFGraph query.

Possible Solution

Based on the provided information, the issue seems to be related to the inability of the query execution engine to find the property val for the variable o when a type specification is included in the query. The error message Error: Binder exception: Cannot find property val for o. indicates that the binder is unable to resolve the property val for the specified type.

To address this issue, consider the following solution:

If the val property is indeed missing from the wklx_r type, the query should be corrected to avoid referencing non-existent properties. If the property exists but is not being resolved correctly, the binder logic will need to be updated to handle type specifications properly.

Code snippets to check