[[dataset::export]]
| 310 | |
| 311 | // [[dataset::export]] |
| 312 | void ExecPlan_Write( |
| 313 | const std::shared_ptr<acero::ExecPlan>& plan, |
| 314 | const std::shared_ptr<acero::ExecNode>& final_node, |
| 315 | const std::shared_ptr<arrow::Schema>& schema, |
| 316 | const std::shared_ptr<ds::FileWriteOptions>& file_write_options, |
| 317 | const std::shared_ptr<fs::FileSystem>& filesystem, std::string base_dir, |
| 318 | const std::shared_ptr<ds::Partitioning>& partitioning, std::string basename_template, |
| 319 | arrow::dataset::ExistingDataBehavior existing_data_behavior, int max_partitions, |
| 320 | uint32_t max_open_files, uint64_t max_rows_per_file, uint64_t min_rows_per_group, |
| 321 | uint64_t max_rows_per_group, bool create_directory, bool preserve_order) { |
| 322 | arrow::dataset::internal::Initialize(); |
| 323 | |
| 324 | // TODO(ARROW-16200): expose FileSystemDatasetWriteOptions in R |
| 325 | // and encapsulate this logic better |
| 326 | ds::FileSystemDatasetWriteOptions opts; |
| 327 | opts.file_write_options = file_write_options; |
| 328 | opts.existing_data_behavior = existing_data_behavior; |
| 329 | opts.filesystem = filesystem; |
| 330 | opts.base_dir = base_dir; |
| 331 | opts.partitioning = partitioning; |
| 332 | opts.basename_template = basename_template; |
| 333 | opts.max_partitions = max_partitions; |
| 334 | opts.max_open_files = max_open_files; |
| 335 | opts.max_rows_per_file = max_rows_per_file; |
| 336 | opts.min_rows_per_group = min_rows_per_group; |
| 337 | opts.max_rows_per_group = max_rows_per_group; |
| 338 | opts.create_dir = create_directory; |
| 339 | opts.preserve_order = preserve_order; |
| 340 | |
| 341 | ds::WriteNodeOptions options(std::move(opts)); |
| 342 | options.custom_schema = std::move(schema); |
| 343 | |
| 344 | MakeExecNodeOrStop("write", final_node->plan(), {final_node.get()}, std::move(options)); |
| 345 | |
| 346 | StopIfNotOk(plan->Validate()); |
| 347 | |
| 348 | arrow::Status result = RunWithCapturedRIfPossibleVoid([&]() { |
| 349 | plan->StartProducing(); |
| 350 | return plan->finished().status(); |
| 351 | }); |
| 352 | |
| 353 | StopIfNotOk(result); |
| 354 | } |
| 355 | |
| 356 | #endif |
| 357 |
no test coverage detected