Skip to content

Commit

Permalink
should pass make format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tmonster committed Dec 5, 2023
1 parent 42d3fb8 commit 34902e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
36 changes: 18 additions & 18 deletions src/execution/operator/helper/physical_reservoir_sample.cpp
Expand Up @@ -112,24 +112,24 @@ SinkCombineResultType PhysicalReservoirSample::Combine(ExecutionContext &context
return SinkCombineResultType::FINISHED;
}

static void PrintSampleCount(vector<unique_ptr<BlockingSample>> &samples) {
idx_t total_count = 0;
for (auto &sample : samples) {
total_count += sample->get_sample_count();
}
std::cout << "samples in reservoir is " << total_count << std::endl;
}

static void PrintAllSeenSamples(ReservoirSamplePercentage &sample_percentage) {
idx_t finished_samples_seen = 0;
for (auto &sample : sample_percentage.finished_samples) {
// auto &tmp = sample->Cast<ReservoirSamplePercentage>();
finished_samples_seen += sample->base_reservoir_sample.num_entries_seen_total;
D_ASSERT(sample->base_reservoir_sample.num_entries_seen_total == 100000);
}
finished_samples_seen += sample_percentage.current_count;
std::cout << "this sample has seen " << finished_samples_seen << " tuples" << std::endl;
}
//static void PrintSampleCount(vector<unique_ptr<BlockingSample>> &samples) {
// idx_t total_count = 0;
// for (auto &sample : samples) {
// total_count += sample->get_sample_count();
// }
// std::cout << "samples in reservoir is " << total_count << std::endl;
//}

//static void PrintAllSeenSamples(ReservoirSamplePercentage &sample_percentage) {
// idx_t finished_samples_seen = 0;
// for (auto &sample : sample_percentage.finished_samples) {
// // auto &tmp = sample->Cast<ReservoirSamplePercentage>();
// finished_samples_seen += sample->base_reservoir_sample.num_entries_seen_total;
// D_ASSERT(sample->base_reservoir_sample.num_entries_seen_total == 100000);
// }
// finished_samples_seen += sample_percentage.current_count;
// std::cout << "this sample has seen " << finished_samples_seen << " tuples" << std::endl;
//}

SinkFinalizeType PhysicalReservoirSample::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
OperatorSinkFinalizeInput &input) const {
Expand Down
2 changes: 0 additions & 2 deletions src/execution/reservoir_sample.cpp
Expand Up @@ -120,7 +120,6 @@ void ReservoirSample::Merge(unique_ptr<BlockingSample> &other) {
return;
}

idx_t replaced_element_count = 0;
// 3. All entries in other can now go into this.reservoir sample
for (auto &weight_pair : temporary_queue) {
if (other->base_reservoir_sample.reservoir_weights.empty()) {
Expand All @@ -133,7 +132,6 @@ void ReservoirSample::Merge(unique_ptr<BlockingSample> &other) {
base_reservoir_sample.min_weighted_entry_index = weight_pair.second;
// replace element in reservoir chunk with the weight from the other reservoir chunk
ReplaceElement(*other_as_rs.reservoir_chunk, min_weight_other.second, min_weight_other.first);
replaced_element_count++;
}
}

Expand Down

0 comments on commit 34902e9

Please sign in to comment.