Commit 7e73421
fix: Initialize null children in SelectiveMapAsStructColumnReader getValues (#17720)
Summary:
Pull Request resolved: #17720
`SelectiveMapAsStructColumnReader::getValues()` iterates over all children of the result RowVector and calls `mutableRawNulls()` on each to initialize null bits. However, when the result RowVector comes from `prepareResult()` in `SelectiveStructColumnReaderBase`, non-ROW children are intentionally left as nullptr (only ROW children are pre-allocated, per the design documented at `SelectiveStructColumnReader.cpp:35-39`). Calling `mutableRawNulls()` on a nullptr child causes a SIGSEGV.
This manifests when delta UPDATE files with MAP-typed columns are read via the Metalake merge-on-read path with `readFlatmapAsStruct` enabled. The `DeltaUpdateReader::loadValues()` copies delta values across Nimble stripes, which triggers lazy loading of MAP-as-struct columns, hitting the null children in `getValues()`.
This diff creates properly-typed empty vectors for any null children before the null-initialization loop, matching the contract that all children start as null (all bits set to `kNull`) before `makeCopyRanges` populates the ones with actual data.
Reviewed By: Yuhta
Differential Revision: D107328181
fbshipit-source-id: f36e57228a53d0f765af3411ea85073c353cd2701 parent fd8f0cf commit 7e73421
2 files changed
Lines changed: 64 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
600 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
601 | 616 | | |
602 | 617 | | |
603 | 618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3076 | 3076 | | |
3077 | 3077 | | |
3078 | 3078 | | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
3079 | 3127 | | |
3080 | 3128 | | |
3081 | 3129 | | |
| |||
0 commit comments