Skip to content

Fix open graph dynamic property filters#454

Open
adsharma wants to merge 1 commit intomainfrom
fix_open_type_graph
Open

Fix open graph dynamic property filters#454
adsharma wants to merge 1 commit intomainfrom
fix_open_type_graph

Conversation

@adsharma
Copy link
Copy Markdown
Contributor

@adsharma adsharma commented May 4, 2026

Fixes: #451

Open type graph dynamic properties are stored in the system data JSON column, but filtered scans were treating them like physical table columns. This made pattern predicates and WHERE predicates on labels such as User.age call property metadata lookups that do not exist for _nodes/_edges, which surfaced as unordered_map::at failures instead of behaving like a declared node or edge table.

Route missing dynamic properties through JSON extraction during scan planning, apply the same casting path for relationship scans, and avoid cardinality estimation lookups for properties that are not physical columns. Add ANY graph regressions for node and relationship property filters so open graphs match the behavior users get after creating explicit node and edge tables.

@adsharma adsharma requested a review from aheev May 4, 2026 16:08
Comment thread test/test_files/graph/any.test Outdated
-LOG QueryDynamicNodePropertyInPatternFilter
-STATEMENT MATCH (u:User {age: 30}) RETURN u.name, u.age
---- 1
"Alice"|30
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t we return a plain string instead of a quoted one, just like the normal graphs?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a test involving string prop filters would help

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both good suggestions. Yes - the ideal of end users can't detect any differences between strictly typed vs open type graphs at the query level is worth going for.

Open type graph dynamic properties are stored in the system data column, but filtered scans were treating them like physical table columns. This made pattern predicates and WHERE predicates on labels such as User.age call property metadata lookups that do not exist for _nodes/_edges, which surfaced as unordered_map::at failures instead of behaving like a declared node or edge table.

Route missing dynamic properties through JSON extraction during scan planning, return scalar JSON strings without serialization quotes, apply the same casting path for relationship scans, and avoid cardinality estimation lookups for properties that are not physical columns. Add ANY graph regressions for numeric and string node filters plus relationship property filters so open graphs match the behavior users get after creating explicit node and edge tables.
@adsharma adsharma force-pushed the fix_open_type_graph branch from 65b1bcd to e73c10f Compare May 5, 2026 04:30
Copy link
Copy Markdown
Contributor

@aheev aheev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except one nit

Comment thread src/common/json_utils.cpp
}

std::string jsonExtractScalarToString(const JsonWrapper& wrapper, std::string path) {
std::vector<std::string> actualPath;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can this code be de-dupped?

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

Successfully merging this pull request may close these issues.

Bug: open type graph error

2 participants