| 46 | } |
| 47 | |
| 48 | int32_t SpillMergeStream::compare(const MergeStream& other) const { |
| 49 | BOLT_CHECK(!closed_); |
| 50 | const auto& otherStream = static_cast<const SpillMergeStream&>(other); |
| 51 | const auto& children = rowVector_->children(); |
| 52 | const auto& otherChildren = otherStream.current().children(); |
| 53 | for (const auto& [key, compareFlags] : sortingKeys()) { |
| 54 | const auto result = children[key] |
| 55 | ->compare( |
| 56 | otherChildren[key].get(), |
| 57 | index_, |
| 58 | otherStream.index_, |
| 59 | compareFlags) |
| 60 | .value(); |
| 61 | if (result != 0) { |
| 62 | return result; |
| 63 | } |
| 64 | } |
| 65 | return 0; |
| 66 | } |
| 67 | |
| 68 | void SpillMergeStream::close() { |
| 69 | BOLT_CHECK(!closed_); |