push 3.3.19 to github (#193)

* push 3.3.19 to github

* merge to 20ed420122a8283200aa37b0a6179b6a571d2837
This commit is contained in:
morningman
2018-05-15 20:38:22 +08:00
committed by Zhao Chun
parent e684ae9b49
commit 2419384e8a
467 changed files with 40454 additions and 17248 deletions

View File

@ -58,6 +58,7 @@ Status SelectNode::get_next(RuntimeState* state, RowBatch* row_batch, bool* eos)
if (reached_limit() || (_child_row_idx == _child_row_batch->num_rows() && _child_eos)) {
// we're already done or we exhausted the last child batch and there won't be any
// new ones
_child_row_batch->transfer_resource_ownership(row_batch);
*eos = true;
return Status::OK;
}
@ -65,23 +66,30 @@ Status SelectNode::get_next(RuntimeState* state, RowBatch* row_batch, bool* eos)
// start (or continue) consuming row batches from child
while (true) {
RETURN_IF_CANCELLED(state);
if (_child_row_idx == _child_row_batch->num_rows()) {
// fetch next batch
RETURN_IF_CANCELLED(state);
row_batch->tuple_data_pool()->acquire_data(_child_row_batch->tuple_data_pool(), false);
_child_row_batch->reset();
RETURN_IF_ERROR(child(0)->get_next(state, _child_row_batch.get(), &_child_eos));
_child_row_idx = 0;
_child_row_batch->transfer_resource_ownership(row_batch);
_child_row_batch->reset();
if (row_batch->at_capacity()) {
return Status::OK;
}
RETURN_IF_ERROR(child(0)->get_next(state, _child_row_batch.get(), &_child_eos));
}
if (copy_rows(row_batch)) {
*eos = reached_limit()
|| (_child_row_idx == _child_row_batch->num_rows() && _child_eos);
if (*eos) {
_child_row_batch->transfer_resource_ownership(row_batch);
}
return Status::OK;
}
if (_child_eos) {
// finished w/ last child row batch, and child eos is true
_child_row_batch->transfer_resource_ownership(row_batch);
*eos = true;
return Status::OK;
}