Conversation
Enhance resolve_denormalized_property_in_expr() to handle both table alias rewriting AND property name mapping using get_properties_with_table_alias(). Key improvements: - Property name resolution now correctly distinguishes from_node vs to_node (e.g., a.city → r.OriginCityName, b.city → r.DestCityName) - Cross-side correction: when schema mapping maps to wrong side's column (e.g., b.city → OriginCityName), reverse-lookups through node schema's from_properties/to_properties to find the correct Cypher property name, then resolves through the correct side's denormalized mapping - Also handles CASE expressions and covers coupled schema aliases Fixes 6 more integration tests across denormalized and coupled schemas. Total: 9 tests promoted from xfail to passing (3 from PR #224 + 6 here). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…riants Address code review findings: 1. Cross-side correction now uses find_label_for_alias_in_plan() to scope the schema search to the specific node label, avoiding false matches when multiple denormalized node types share DB column names. 2. Added recursive descent for List, MapLiteral, ArraySubscript, ArraySlicing, InSubquery, and ReduceExpr variants. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolve_denormalized_property_in_expr()inplan_builder_utils.rsto handle both table alias rewriting AND property name mapping, replacing the alias-only approach from PR fix: denormalized node alias rewriting in WITH CTE body #224a.city→r.OriginCityName(from_node) vsb.city→r.DestCityName(to_node) now correctly resolved usingget_properties_with_table_alias()which is aware of the node's position in the relationshiprewrite_expression_with_property_mappingmaps a property to the wrong side's DB column (e.g.,b.city→OriginCityName), the function reverse-lookups through the node schema'sfrom_properties/to_propertiesto find the original Cypher property name, then resolves it through the correct side's denormalized mappingTest plan
🤖 Generated with Claude Code