Skip to content

[codex] Fix nested JSON string access - #3

Closed
friendlymatthew wants to merge 1 commit into
mainfrom
friendlymatthew/fix-nested-json-string-access
Closed

friendlymatthew wants to merge 1 commit into
mainfrom
friendlymatthew/fix-nested-json-string-access

Conversation

@friendlymatthew

Copy link
Copy Markdown

Summary

  • Stop flattening nested JSON calls when the inner call is json_as_text
  • Keep the existing json_get(json_get(...)) unnest optimization intact
  • Add regressions for extracting from JSON strings that contain valid nested JSON

Why

json_as_text returns SQL text, not a preserved JSON value. Flattening json_as_text(json_as_text(...), 'device_id') into a single path lookup skips the intermediate unescaped JSON string and returns null for values like {"user_id":"{\"device_id\":\"abc\"}"}.

Validation

  • cargo fmt
  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings

@friendlymatthew friendlymatthew self-assigned this Jun 26, 2026
@friendlymatthew
friendlymatthew marked this pull request as ready for review June 26, 2026 11:16
@friendlymatthew

Copy link
Copy Markdown
Author

Closed in favor of upstream PR datafusion-contrib#121: datafusion-contrib#121

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.

1 participant