Skip to content

Conversation

@nicktobey
Copy link
Contributor

The inputs to the JSON_OBJECT function are expected to be strings for the keys, and the expected types for the values. So we need to check whether the inputs are wrapper values and unwrap them.

The safest thing to do is unwrap the value when the document is created, so this PR does that. In theory, allowed wrapped values to be used as document values and unwrapping them at the use site could improve performance for certain queries that create JSON objects in memory but then only read some of the fields. But that's likely an infrequent enough situation that it's not worth the added complexity.

@nicktobey
Copy link
Contributor Author

Fixes dolthub/dolt#9222

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM

@nicktobey nicktobey merged commit a3bdbd6 into main May 15, 2025
9 checks passed
@nicktobey nicktobey deleted the nicktobey/unwrap3 branch May 15, 2025 22:25
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.

3 participants