Commit 9e3d1f3
authored
[refine](column) replace field-based nested default with column-level operation in ColumnVariant (#62547)
`ColumnVariant::try_insert_default_from_nested` was filling missing
nested subcolumn rows by
converting the last row of a sibling leaf column to a `Field`,
recursively walking the `Field`
tree via `FieldVisitorReplaceScalars` to replace scalar values with the
type default, and then
inserting the resulting `Field` back into the column.
This approach was unnecessarily expensive (column → Field → Field tree
traversal → column) and
inconsistent with the batch counterpart
`try_insert_many_defaults_from_nested`, which operates
entirely at the column level using `cut` + `clone_with_default_values`.
The scalar visitor (`FieldVisitorReplaceScalars`) existed as duplicate
dead code in both
`column_variant.cpp` and `variant_util.cpp`.
### Changes
- **`try_insert_default_from_nested`**: rewrite to use the same
column-level approach as
`try_insert_many_defaults_from_nested` — `leaf->data.cut(leaf_size - 1,
1).clone_with_default_values(field_info)` — eliminating the Field
round-trip and the dependency on `get_default()` /
`FieldVisitorReplaceScalars`.
- **Remove `FieldVisitorReplaceScalars`** from both `column_variant.cpp`
and `variant_util.cpp`; neither file has any remaining callers.
- **Remove `field_visitor` unit test** in `column_variant_test.cpp` that
directly tested the now-deleted visitor class.1 parent 2bc4487 commit 9e3d1f3
File tree
3 files changed
+15
-99
lines changed- be
- src
- core/column
- exec/common
- test/core/column
3 files changed
+15
-99
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2488 | 2488 | | |
2489 | 2489 | | |
2490 | 2490 | | |
2491 | | - | |
2492 | | - | |
2493 | | - | |
2494 | | - | |
2495 | | - | |
2496 | | - | |
2497 | | - | |
2498 | | - | |
2499 | | - | |
2500 | | - | |
2501 | | - | |
2502 | | - | |
2503 | | - | |
2504 | | - | |
2505 | | - | |
2506 | | - | |
2507 | | - | |
2508 | | - | |
2509 | | - | |
2510 | | - | |
2511 | | - | |
2512 | | - | |
2513 | | - | |
2514 | | - | |
2515 | | - | |
2516 | | - | |
2517 | | - | |
2518 | | - | |
2519 | | - | |
2520 | | - | |
2521 | | - | |
2522 | 2491 | | |
2523 | 2492 | | |
2524 | 2493 | | |
2525 | 2494 | | |
2526 | 2495 | | |
2527 | 2496 | | |
2528 | | - | |
2529 | | - | |
| 2497 | + | |
| 2498 | + | |
2530 | 2499 | | |
2531 | 2500 | | |
2532 | 2501 | | |
2533 | | - | |
2534 | | - | |
2535 | | - | |
2536 | | - | |
2537 | | - | |
2538 | | - | |
2539 | | - | |
2540 | | - | |
2541 | | - | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
2542 | 2506 | | |
2543 | 2507 | | |
2544 | | - | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
2545 | 2512 | | |
2546 | | - | |
2547 | | - | |
2548 | | - | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
2549 | 2518 | | |
2550 | 2519 | | |
2551 | 2520 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1821 | 1821 | | |
1822 | 1822 | | |
1823 | 1823 | | |
1824 | | - | |
1825 | | - | |
1826 | | - | |
1827 | | - | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
1838 | | - | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | 1824 | | |
1854 | 1825 | | |
1855 | 1826 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3082 | 3082 | | |
3083 | 3083 | | |
3084 | 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 | 3085 | | |
3110 | 3086 | | |
3111 | 3087 | | |
| |||
0 commit comments