| 475 | } |
| 476 | |
| 477 | Status 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 | |
| 500 | Status EnsureDestinationValid(const FileSystemDatasetWriteOptions& options) { |
| 501 | if (options.existing_data_behavior == ExistingDataBehavior::kError) { |
no test coverage detected