Skip to content

Conversation

@kgpai
Copy link
Contributor

@kgpai kgpai commented Dec 19, 2025

Summary:
When casting nested ROW types to JSON, castToJsonFromRow would process all child elements including those at null positions. Since Velox vectors can have invalid data at null positions (e.g., Timestamp with nanos > 1 billion), this could cause crashes during JSON serialization.

The fix is to filter out null rows from each child's SelectivityVector before creating AsJson. When all rows are null for a child, store std::nullopt and output "null" directly during rendering. This prevents accessing potentially invalid underlying data at null positions.

Differential Revision: D89577815

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 19, 2025
@meta-codesync
Copy link

meta-codesync bot commented Dec 19, 2025

@kgpai has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89577815.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 084c33f
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/6945d468d68bcb00085bbccf

…#15828)

Summary:

When casting nested ROW types to JSON, castToJsonFromRow would process all child elements including those at null positions. Since Velox vectors can have invalid data at null positions (e.g., Timestamp with nanos > 1 billion), this could cause crashes during JSON serialization.

The fix is to filter out null rows from each child's SelectivityVector before creating AsJson. When all rows are null for a child, store std::nullopt and output "null" directly during rendering. This prevents accessing potentially invalid underlying data at null positions.

Differential Revision: D89577815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant