Implement double-encoding escaping mechanism for column names with escape sequence prefix #3056
+203
−4
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.
Why make this change?
Addresses review feedback from #3051 requesting a more robust escaping mechanism to handle edge cases where column names already contain the escape sequence "DAB_ESCAPE$".
What is this change?
Double-Encoding Strategy
Enhanced the serialization escaping logic with two-step processing:
DAB_ESCAPE$→DAB_ESCAPE$DAB_ESCAPE$...$→DAB_ESCAPE$...Deserialization reverses this in opposite order to restore original names.
Prevent Double-Escaping
Added HashSet tracking in
Write()method to handle cases whereSourceDefinitionandTableDefinitionproperties reference the same object instance.Example Transformations
$FirstName→DAB_ESCAPE$FirstName(existing behavior, unchanged)DAB_ESCAPE$FirstName→DAB_ESCAPE$DAB_ESCAPE$FirstName(new edge case)RegularColumn→RegularColumn(unchanged)How was this tested?
Added test cases covering:
Note: Existing serialization tests pass, confirming backward compatibility. New edge case tests demonstrate the double-encoding logic but require investigation - the in-place dictionary modifications are not reflecting in serialized JSON output despite working correctly in isolation.
Sample Request(s)
N/A - Internal serialization mechanism change with no API surface modifications.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.