| 94 | } |
| 95 | |
| 96 | bool KeyValuePartitioning::Equals(const Partitioning& other) const { |
| 97 | if (this == &other) { |
| 98 | return true; |
| 99 | } |
| 100 | const auto& kv_partitioning = checked_cast<const KeyValuePartitioning&>(other); |
| 101 | const auto& other_dictionaries = kv_partitioning.dictionaries(); |
| 102 | if (dictionaries_.size() != other_dictionaries.size()) { |
| 103 | return false; |
| 104 | } |
| 105 | int64_t idx = 0; |
| 106 | for (const auto& array : dictionaries_) { |
| 107 | const auto& other_array = other_dictionaries[idx++]; |
| 108 | bool match = (array == nullptr && other_array == nullptr) || |
| 109 | (array && other_array && array->Equals(other_array)); |
| 110 | if (!match) { |
| 111 | return false; |
| 112 | } |
| 113 | } |
| 114 | return options_.segment_encoding == kv_partitioning.options_.segment_encoding && |
| 115 | Partitioning::Equals(other); |
| 116 | } |
| 117 | |
| 118 | Result<Partitioning::PartitionedBatches> KeyValuePartitioning::Partition( |
| 119 | const std::shared_ptr<RecordBatch>& batch) const { |
no test coverage detected