Commit be0ede7
authored
[Variant] ParentState handles finish/rollback for builders (apache#8185)
# Which issue does this PR close?
- Closes apache#8182 (directly)
- Closes apache#8170 (as a side
effect)
- Closes apache#8180 (as a side
effect)
# Rationale for this change
Make finish/rollback handling simpler, robust and uniform by pulling it
inside `ParentState` (instead of each builder doing it manually) and
making it fully eager (instead of a mix of eager and lazy).
# What changes are included in this PR?
See above.
# Are these changes tested?
Yes, existing unit tests cover it (including some that needed adjustment
due to behavior changes), along with some new testing.
# Are there any user-facing changes?
`ObjectBuilder` methods `new_list` and `new_object` now panic if a
duplicate field name is provided, and new fallible versions
`try_new_list` and `try_new_object` are provided.
`ObjectBuilder::finish` signature remains fallible, but it always
returns `Result::Ok`
* TODO: apache#8184
Existing `VariantBuilderExt` methods `new_list` and `new_object` now
panic if they encounter a duplicate field name; new fallible versions
`try_new_list` and `try_new_object` are provided.1 parent 8875504 commit be0ede7
File tree
3 files changed
+304
-237
lines changed- parquet-variant-compute/src
- parquet-variant-json/src
- parquet-variant/src
3 files changed
+304
-237
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
| 225 | + | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
| 229 | + | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
| 149 | + | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
627 | 627 | | |
628 | 628 | | |
629 | 629 | | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| |||
0 commit comments