Commit ac81eb2
Improve docs and add build() method to
# Which issue does this PR close?
- Part of #9128
- Follow on to #9120
# Rationale for this change
I am trying to encourage people to avoid using ArrayData when
constructing arrays (as it is slower than just creating the arrays
directly). Part of doing so is ensuring that the APIs to create the
necessary pieces (NullBuffers in particular) are easy to use / well
documented.
As pointed out by @scovich on
#9120 (comment), it
is
1. Not obvious how `finish` works (resets the builder)
2. Why there is no `build` method (when there is a From impl)
Thus, let's add `build` methods to `NullBufferBuilder` and document the
difference between `finish` and `build`
While I was working on this change, I noticed the same issue with
`BufferBuilder` and `BooleanBufferBuilder` so I also made them
consistent
# What changes are included in this PR?
1. Improve docs and Add build() method to {Null,Boolean,}BufferBuilder
# Are these changes tested?
Yes by CI and new doc examples
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
If there are any breaking changes to public APIs, please call them out.
-->
---------
Co-authored-by: Ed Seidl <etseidl@users.noreply.github.com>{Null,Boolean,}BufferBuilder (#9155)1 parent 7a85e90 commit ac81eb2
File tree
4 files changed
+87
-24
lines changed- arrow-buffer/src
- buffer
- builder
4 files changed
+87
-24
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 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
27 | 43 | | |
28 | | - | |
| 44 | + | |
| 45 | + | |
29 | 46 | | |
30 | 47 | | |
31 | 48 | | |
| |||
247 | 264 | | |
248 | 265 | | |
249 | 266 | | |
250 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
251 | 270 | | |
252 | 271 | | |
253 | 272 | | |
254 | 273 | | |
255 | 274 | | |
256 | 275 | | |
257 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
258 | 285 | | |
259 | 286 | | |
260 | 287 | | |
| |||
285 | 312 | | |
286 | 313 | | |
287 | 314 | | |
288 | | - | |
| 315 | + | |
289 | 316 | | |
290 | 317 | | |
291 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
42 | | - | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
47 | | - | |
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| |||
341 | 349 | | |
342 | 350 | | |
343 | 351 | | |
| 352 | + | |
| 353 | + | |
344 | 354 | | |
345 | 355 | | |
346 | 356 | | |
347 | 357 | | |
348 | | - | |
349 | 358 | | |
350 | 359 | | |
351 | | - | |
352 | 360 | | |
353 | | - | |
354 | 361 | | |
355 | 362 | | |
356 | 363 | | |
| |||
359 | 366 | | |
360 | 367 | | |
361 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
362 | 387 | | |
363 | 388 | | |
364 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
31 | | - | |
32 | | - | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
196 | | - | |
197 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
198 | 203 | | |
199 | 204 | | |
200 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
201 | 213 | | |
202 | 214 | | |
203 | 215 | | |
| |||
238 | 250 | | |
239 | 251 | | |
240 | 252 | | |
241 | | - | |
242 | 253 | | |
243 | | - | |
244 | 254 | | |
245 | 255 | | |
246 | 256 | | |
| |||
0 commit comments