Repository navigation
Commit c2d5878
[fix](variant) Address review: keep empty arrays out of the empty-object rule
Two follow-ups on the per-part empty-object rule and the root-value scan.
The per-part rule keyed off get_base_type_of_array(), which strips every array
layer, so it also matched Array(Nothing) - the type an empty array gets, since
an empty array carries no element type. That is not an absent value the way an
untyped part is: it is `[]`, and the array serde renders it. In an unfinalized
subcolumn whose later part promotes the column-level least common type past
Array(Nothing), a `[]` sitting in the unpromoted part came back as `{}`. Key
the rule off the part's own type instead, which is exactly "scalar Nothing".
The root-value scan walked the whole root null map. Only the rows this call
converts should have a say: prepare_remove_nullable hands the outer null map
over as a separate argument and leaves the masked rows' payloads in place, so a
masked row whose root carries a value kept every visible row on the root
conversion. Bound the scan by input_rows_count and skip masked rows.
ColumnVariantEmptyObjectTest.empty_array_part_is_not_an_empty_object covers the
first one: it fails on the previous check with
`part type Nullable(Array(Nullable(Nothing))), column type
Nullable(Array(Nullable(TINYINT)))` returning `{}` instead of `[]`, and passes
with this change. All 6 cases in the suite pass.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FE4hQXyTkfCbqkMGbokU6e1 parent e3c52e0 commit c2d5878
3 files changed
Lines changed: 63 additions & 4 deletions
File tree
- be
- src
- core/column
- exprs/function/cast
- test/core/column
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1446 | 1446 | | |
1447 | 1447 | | |
1448 | 1448 | | |
1449 | | - | |
1450 | | - | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
1451 | 1453 | | |
1452 | 1454 | | |
1453 | 1455 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
94 | | - | |
95 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
96 | 113 | | |
97 | 114 | | |
98 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3706 | 3706 | | |
3707 | 3707 | | |
3708 | 3708 | | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
3709 | 3719 | | |
3710 | 3720 | | |
3711 | 3721 | | |
| |||
3832 | 3842 | | |
3833 | 3843 | | |
3834 | 3844 | | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
3835 | 3875 | | |
0 commit comments