Commit a869f96
apacheGH-34565: [C++] Teach dataset_writer to accept custom filename functor (apache#34984)
### Rationale for this change
Existing basename_template will only use a monotonically increasing int as new filenames. when there is needs for custom filenames(left padding, hash-code), downstream users must rename the files in a post-processing step.
### What changes are included in this PR?
A new functor is added to FileSystemDatasetWriteOptions which allows users to provide a custom name for dataset_writer.
### Are these changes tested?
Yes. Unit tests are added for normal and ill-formed lambdas.
### Are there any user-facing changes?
Yes. It allows users to customize output file names.
* Closes: apache#34565
Authored-by: Haocheng Liu <lbtinglb@gmail.com>
Signed-off-by: Weston Pace <weston.pace@gmail.com>1 parent da40413 commit a869f96
3 files changed
Lines changed: 51 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
308 | 309 | | |
309 | 310 | | |
310 | 311 | | |
311 | | - | |
312 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
313 | 321 | | |
314 | 322 | | |
315 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
316 | 328 | | |
317 | 329 | | |
318 | 330 | | |
| |||
406 | 418 | | |
407 | 419 | | |
408 | 420 | | |
| 421 | + | |
409 | 422 | | |
410 | 423 | | |
411 | 424 | | |
| |||
418 | 431 | | |
419 | 432 | | |
420 | 433 | | |
| 434 | + | |
421 | 435 | | |
422 | 436 | | |
423 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
279 | 308 | | |
280 | 309 | | |
281 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
407 | 413 | | |
408 | 414 | | |
409 | 415 | | |
| |||
0 commit comments