Skip to content

Commit

Permalink
Fix bug. fix materialize sink bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
small-turtle-1 committed Dec 26, 2023
1 parent e05abc2 commit a26304d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,10 @@ sift_1m
test/data/benchmark/*

# ignore valgrind output file
callgrind.out.*
callgrind.out.*

# ignore vscode config file
.vscode/

# ignore vscode clangd cache file
.cache/
25 changes: 20 additions & 5 deletions src/executor/operator/physical_sink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ void PhysicalSink::FillSinkStateFromLastOperatorState(MaterializeSinkState *mate
}
case PhysicalOperatorType::kShow: {
ShowOperatorState *show_output_state = static_cast<ShowOperatorState *>(task_op_state);
materialize_sink_state->data_block_array_ = Move(show_output_state->output_);
for (auto &data_block : show_output_state->output_) {
materialize_sink_state->data_block_array_.emplace_back(Move(data_block));
}
show_output_state->output_.clear();
break;
}
case PhysicalOperatorType::kExplain: {
Expand All @@ -90,7 +93,10 @@ void PhysicalSink::FillSinkStateFromLastOperatorState(MaterializeSinkState *mate
Error<ExecutorException>("Empty explain output");
}

materialize_sink_state->data_block_array_ = Move(explain_output_state->data_block_array_);
for (auto &data_block : explain_output_state->data_block_array_) {
materialize_sink_state->data_block_array_.emplace_back(Move(data_block));
}
explain_output_state->data_block_array_.clear();
break;
}
case PhysicalOperatorType::kProjection: {
Expand All @@ -102,7 +108,10 @@ void PhysicalSink::FillSinkStateFromLastOperatorState(MaterializeSinkState *mate
Error<ExecutorException>("Empty projection output");
}
} else {
materialize_sink_state->data_block_array_ = Move(projection_output_state->data_block_array_);
for (auto &data_block : projection_output_state->data_block_array_) {
materialize_sink_state->data_block_array_.emplace_back(Move(data_block));
}
projection_output_state->data_block_array_.clear();
}
break;
}
Expand All @@ -115,7 +124,10 @@ void PhysicalSink::FillSinkStateFromLastOperatorState(MaterializeSinkState *mate
Error<ExecutorException>("Empty sort output");
}
} else {
materialize_sink_state->data_block_array_ = Move(sort_output_state->data_block_array_);
for (auto &data_block : sort_output_state->data_block_array_) {
materialize_sink_state->data_block_array_.emplace_back(Move(data_block));
}
sort_output_state->data_block_array_.clear();
}
break;
}
Expand All @@ -126,7 +138,10 @@ void PhysicalSink::FillSinkStateFromLastOperatorState(MaterializeSinkState *mate
Error<ExecutorException>("Empty knn scan output");
}

materialize_sink_state->data_block_array_ = Move(knn_output_state->data_block_array_);
for (auto &data_block : knn_output_state->data_block_array_) {
materialize_sink_state->data_block_array_.emplace_back(Move(data_block));
}
knn_output_state->data_block_array_.clear();
break;
}
default: {
Expand Down

0 comments on commit a26304d

Please sign in to comment.