| 800 | } |
| 801 | |
| 802 | Result<std::shared_ptr<Partitioning>> Finish( |
| 803 | const std::shared_ptr<Schema>& schema) const override { |
| 804 | if (dictionaries_.empty()) { |
| 805 | return std::make_shared<HivePartitioning>(schema, dictionaries_); |
| 806 | } else { |
| 807 | for (FieldRef ref : field_names_) { |
| 808 | // ensure all of field_names_ are present in schema |
| 809 | RETURN_NOT_OK(ref.FindOne(*schema)); |
| 810 | } |
| 811 | |
| 812 | // drop fields which aren't in field_names_ |
| 813 | auto out_schema = SchemaFromColumnNames(schema, field_names_); |
| 814 | |
| 815 | return std::make_shared<HivePartitioning>(std::move(out_schema), dictionaries_, |
| 816 | options_.AsHivePartitioningOptions()); |
| 817 | } |
| 818 | } |
| 819 | |
| 820 | private: |
| 821 | const HivePartitioningFactoryOptions options_; |
nothing calls this directly
no test coverage detected