Open vikramsubramanian opened 4 months ago
Summary: Inconsistent behavior with binding error for RDFGraph query.
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:
wklx_r
type to ensure that the property val
exists. If the property does not exist, it may be necessary to update the schema or adjust the query to reference a valid property.val
does exist for the wklx_r
type, inspect the binder logic in the src/binder/bind/copy/bind_copy_rdf_graph.cpp
file to ensure that it correctly resolves properties for nodes of type wklx_r
. Specifically, check the logic that binds the val
property to ensure it is correctly handling type specifications in queries.val
may only be present on one of these types. The binder should correctly identify the type of node o
is when the type specification is provided.val
property is specific to literals and not resources, the binder logic may need to be adjusted to correctly handle queries that involve both resource and literal nodes, ensuring that properties are accessed from the correct node type.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.
src/binder/bind/copy/bind_copy_rdf_graph.cpp
This file contains logic related to RDF graph binding and scanning, which is directly related to the issue of inconsistent behavior for binder errors and potential unnecessary joins due to type resolutions.
src/binder/bind/copy/bind_copy_rdf_graph.cpp
This snippet also pertains to the binding and scanning of RDF graphs, which may need to be reviewed to ensure correct type resolutions and to avoid performance issues.
I have an RDFGraph named wklx. I am running the following query:
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.
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. )