-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'branch-3.0' into pick_42224_to_apache_branch-3.0
- Loading branch information
Showing
98 changed files
with
5,519 additions
and
1,078 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
name: Auto Cherry-Pick to Branch | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- master | ||
|
||
jobs: | ||
auto_cherry_pick: | ||
runs-on: ubuntu-latest | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'dev/3.0.x') && github.event.pull_request.merged == true }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install PyGithub | ||
- name: Auto cherry-pick | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO_NAME: ${{ github.repository }} | ||
CONFLICT_LABEL: cherry-pick-conflict-in-3.0 | ||
run: | | ||
python tools/auto-pick-script.py ${{ github.event.pull_request.number }} branch-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
#include "cache_sink_operator.h" | ||
|
||
#include <utility> | ||
|
||
#include "common/compiler_util.h" // IWYU pragma: keep | ||
#include "common/status.h" | ||
#include "pipeline/exec/data_queue.h" | ||
#include "pipeline/exec/operator.h" | ||
#include "runtime/runtime_state.h" | ||
#include "util/runtime_profile.h" | ||
|
||
namespace doris::pipeline { | ||
|
||
Status CacheSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& info) { | ||
RETURN_IF_ERROR(Base::init(state, info)); | ||
SCOPED_TIMER(exec_time_counter()); | ||
SCOPED_TIMER(_init_timer); | ||
_shared_state->data_queue.set_sink_dependency(_dependency, 0); | ||
return Status::OK(); | ||
} | ||
|
||
Status CacheSinkLocalState::open(RuntimeState* state) { | ||
SCOPED_TIMER(exec_time_counter()); | ||
SCOPED_TIMER(_open_timer); | ||
RETURN_IF_ERROR(Base::open(state)); | ||
// auto& p = _parent->cast<Parent>(); | ||
|
||
_shared_state->data_queue.set_max_blocks_in_sub_queue(state->data_queue_max_blocks()); | ||
return Status::OK(); | ||
} | ||
|
||
CacheSinkOperatorX::CacheSinkOperatorX(int sink_id, int child_id) | ||
: Base(sink_id, child_id, child_id) { | ||
_name = "CACHE_SINK_OPERATOR"; | ||
} | ||
|
||
Status CacheSinkOperatorX::open(RuntimeState* state) { | ||
return Status::OK(); | ||
} | ||
|
||
Status CacheSinkOperatorX::sink(RuntimeState* state, vectorized::Block* in_block, bool eos) { | ||
auto& local_state = get_local_state(state); | ||
SCOPED_TIMER(local_state.exec_time_counter()); | ||
COUNTER_UPDATE(local_state.rows_input_counter(), (int64_t)in_block->rows()); | ||
|
||
if (in_block->rows() > 0) { | ||
local_state._shared_state->data_queue.push_block( | ||
vectorized::Block::create_unique(std::move(*in_block)), 0); | ||
} | ||
if (UNLIKELY(eos)) { | ||
local_state._shared_state->data_queue.set_finish(0); | ||
} | ||
return Status::OK(); | ||
} | ||
|
||
} // namespace doris::pipeline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
#include <memory> | ||
|
||
#include "common/status.h" | ||
#include "operator.h" | ||
#include "vec/core/block.h" | ||
|
||
namespace doris { | ||
class RuntimeState; | ||
|
||
namespace pipeline { | ||
class DataQueue; | ||
|
||
class CacheSinkOperatorX; | ||
class CacheSinkLocalState final : public PipelineXSinkLocalState<CacheSharedState> { | ||
public: | ||
ENABLE_FACTORY_CREATOR(CacheSinkLocalState); | ||
CacheSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state) : Base(parent, state) {} | ||
Status init(RuntimeState* state, LocalSinkStateInfo& info) override; | ||
Status open(RuntimeState* state) override; | ||
friend class CacheSinkOperatorX; | ||
using Base = PipelineXSinkLocalState<CacheSharedState>; | ||
using Parent = CacheSinkOperatorX; | ||
}; | ||
|
||
class CacheSinkOperatorX final : public DataSinkOperatorX<CacheSinkLocalState> { | ||
public: | ||
using Base = DataSinkOperatorX<CacheSinkLocalState>; | ||
|
||
friend class CacheSinkLocalState; | ||
CacheSinkOperatorX(int sink_id, int child_id); | ||
~CacheSinkOperatorX() override = default; | ||
Status init(const TDataSink& tsink) override { | ||
return Status::InternalError("{} should not init with TDataSink", | ||
DataSinkOperatorX<CacheSinkLocalState>::_name); | ||
} | ||
|
||
Status open(RuntimeState* state) override; | ||
|
||
Status sink(RuntimeState* state, vectorized::Block* in_block, bool eos) override; | ||
|
||
std::shared_ptr<BasicSharedState> create_shared_state() const override { | ||
std::shared_ptr<BasicSharedState> ss = std::make_shared<CacheSharedState>(); | ||
ss->id = operator_id(); | ||
for (auto& dest : dests_id()) { | ||
ss->related_op_ids.insert(dest); | ||
} | ||
return ss; | ||
} | ||
}; | ||
|
||
} // namespace pipeline | ||
} // namespace doris |
Oops, something went wrong.