| 124 | } |
| 125 | |
| 126 | RowVectorPtr Exchange::getOutput() { |
| 127 | if (currentPages_.empty()) { |
| 128 | return nullptr; |
| 129 | } |
| 130 | |
| 131 | uint64_t rawInputBytes{0}; |
| 132 | vector_size_t resultOffset = 0; |
| 133 | for (const auto& page : currentPages_) { |
| 134 | rawInputBytes += page->size(); |
| 135 | |
| 136 | auto inputStream = page->prepareStreamForDeserialize(); |
| 137 | |
| 138 | while (!inputStream->atEnd()) { |
| 139 | getSerde()->deserialize( |
| 140 | inputStream.get(), |
| 141 | pool(), |
| 142 | outputType_, |
| 143 | &result_, |
| 144 | resultOffset, |
| 145 | &options_); |
| 146 | resultOffset = result_->size(); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | currentPages_.clear(); |
| 151 | |
| 152 | { |
| 153 | auto lockedStats = stats_.wlock(); |
| 154 | lockedStats->rawInputBytes += rawInputBytes; |
| 155 | lockedStats->rawInputPositions += result_->size(); |
| 156 | lockedStats->addInputVector(result_->estimateFlatSize(), result_->size()); |
| 157 | } |
| 158 | |
| 159 | return result_; |
| 160 | } |
| 161 | |
| 162 | void Exchange::close() { |
| 163 | SourceOperator::close(); |
nothing calls this directly
no test coverage detected