MCPcopy Create free account
hub / github.com/apache/arrow / ExecPlan_Write

Function ExecPlan_Write

r/src/compute-exec.cpp:310–352  ·  view source on GitHub ↗

[[dataset::export]]

Source from the content-addressed store, hash-verified

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

Callers 1

_arrow_ExecPlan_WriteFunction · 0.85

Calls 9

MakeExecNodeOrStopFunction · 0.85
StopIfNotOkFunction · 0.85
finishedMethod · 0.80
InitializeFunction · 0.50
getMethod · 0.45
ValidateMethod · 0.45
StartProducingMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected