Skip to content

Commit

Permalink
minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Tmonster committed Jan 10, 2023
1 parent b5c6d61 commit 01c4b89
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Expand Up @@ -61,7 +61,6 @@ void PhysicalReservoirSample::GetData(ExecutionContext &context, DataChunk &chun
if (!sample_chunk) {
return;
}

chunk.Move(*sample_chunk);
}

Expand Down
2 changes: 0 additions & 2 deletions src/execution/reservoir_sample.cpp
Expand Up @@ -43,7 +43,6 @@ void ReservoirSample::AddToReservoir(DataChunk &input) {
}

unique_ptr<DataChunk> ReservoirSample::GetChunk() {
// TODO: The calling functions need to be updated because maybe we don't want to delete everything?
if (num_added_samples == 0) {
return nullptr;
}
Expand All @@ -62,7 +61,6 @@ unique_ptr<DataChunk> ReservoirSample::GetChunk() {
ret->SetCardinality(STANDARD_VECTOR_SIZE);
// reduce capacity and cardinality of the sample data chunk
reservoir_chunk->SetCardinality(samples_remaining);
// reservoir_chunk->SetCapacity(samples_remaining);
num_added_samples = samples_remaining;
return ret;
}
Expand Down
3 changes: 2 additions & 1 deletion src/include/duckdb/execution/reservoir_sample.hpp
Expand Up @@ -95,7 +95,8 @@ class ReservoirSamplePercentage : public BlockingSample {
constexpr static idx_t RESERVOIR_THRESHOLD = 100000;

public:
ReservoirSamplePercentage(Allocator &allocator, double percentage, int64_t seed);
ReservoirSamplePercentage(Allocator
&allocator, double percentage, int64_t seed);

//! Add a chunk of data to the sample
void AddToReservoir(DataChunk &input) override;
Expand Down

0 comments on commit 01c4b89

Please sign in to comment.