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

Function ValidateOptions

cpp/src/arrow/dataset/dataset_writer.cc:477–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477Status ValidateOptions(const FileSystemDatasetWriteOptions& options) {
478 ARROW_RETURN_NOT_OK(ValidateBasenameTemplate(options.basename_template));
479 if (!options.file_write_options) {
480 return Status::Invalid("Must provide file_write_options");
481 }
482 if (!options.filesystem) {
483 return Status::Invalid("Must provide filesystem");
484 }
485 if (options.max_rows_per_group <= 0) {
486 return Status::Invalid("max_rows_per_group must be a positive number");
487 }
488 if (options.max_rows_per_group < options.min_rows_per_group) {
489 return Status::Invalid(
490 "min_rows_per_group must be less than or equal to max_rows_per_group");
491 }
492 if (options.max_rows_per_file > 0 &&
493 options.max_rows_per_file < options.max_rows_per_group) {
494 return Status::Invalid(
495 "max_rows_per_group must be less than or equal to max_rows_per_file");
496 }
497 return Status::OK();
498}
499
500Status EnsureDestinationValid(const FileSystemDatasetWriteOptions& options) {
501 if (options.existing_data_behavior == ExistingDataBehavior::kError) {

Callers 3

MakeMethod · 0.70
MakeMethod · 0.50

Calls 3

ValidateBasenameTemplateFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected