You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/07 02:59:43 UTC
[GitHub] [doris] mrhhsg opened a new pull request, #14868: [feature](pipeline) add inersect/except operators
mrhhsg opened a new pull request, #14868:
URL: https://github.com/apache/doris/pull/14868
# Proposed changes
This PR contains:
1. Refactor the VSetOperationNode(removing `vintersect_node.cpp`/`vexcept_node.cpp`).
2. Add sink & source operators for intersec/except node.
## Problem summary
Describe your changes.
## Checklist(Required)
1. Does it affect the original behavior:
- [ ] Yes
- [ ] No
- [ ] I don't know
3. Has unit tests been added:
- [ ] Yes
- [ ] No
- [ ] No Need
4. Has document been added or modified:
- [ ] Yes
- [ ] No
- [ ] No Need
5. Does it need to update dependencies:
- [ ] Yes
- [ ] No
6. Are there any changes that cannot be rolled back:
- [ ] Yes (If Yes, please explain WHY)
- [ ] No
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] HappenLee commented on a diff in pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
HappenLee commented on code in PR #14868:
URL: https://github.com/apache/doris/pull/14868#discussion_r1043015397
##########
be/src/pipeline/exec/operator.h:
##########
@@ -251,7 +251,7 @@ class DataSinkOperator : public OperatorBase {
virtual Status sink(RuntimeState* state, vectorized::Block* in_block,
SourceState source_state) override {
SCOPED_TIMER(_runtime_profile->total_time_counter());
- if (!UNLIKELY(in_block)) {
+ if (UNLIKELY(!in_block || in_block->rows() == 0)) {
Review Comment:
`in_block->rows() == 0` do not mean `eos` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] HappenLee commented on a diff in pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
HappenLee commented on code in PR #14868:
URL: https://github.com/apache/doris/pull/14868#discussion_r1043104392
##########
be/src/pipeline/pipeline_task.cpp:
##########
@@ -141,12 +141,11 @@ Status PipelineTask::execute(bool* eos) {
*eos = _data_state == SourceState::FINISHED;
if (_block->rows() != 0 || *eos) {
SCOPED_TIMER(_sink_timer);
- RETURN_IF_ERROR(_sink->sink(_state, block, _data_state));
+ _sink->sink(_state, block, _data_state);
Review Comment:
why not `RETURN_IF_ERROR`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] HappenLee commented on a diff in pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
HappenLee commented on code in PR #14868:
URL: https://github.com/apache/doris/pull/14868#discussion_r1043212697
##########
be/src/vec/exec/vset_operation_node.cpp:
##########
@@ -312,28 +445,73 @@ Status VSetOperationNode::process_build_block(Block& block, uint8_t offset) {
return Status::OK();
}
-Status VSetOperationNode::process_probe_block(RuntimeState* state, int child_id, bool* eos) {
- if (!_probe_column_inserted_id.empty()) {
- for (int j = 0; j < _probe_column_inserted_id.size(); ++j) {
- auto column_to_erase = _probe_column_inserted_id[j];
- _probe_block.erase(column_to_erase - j);
- }
- _probe_column_inserted_id.clear();
+template <bool is_intersect>
+void VSetOperationNode<is_intersect>::add_result_columns(RowRefListWithFlags& value,
+ int& block_size) {
+ auto it = value.begin();
+ for (auto idx = _build_col_idx.begin(); idx != _build_col_idx.end(); ++idx) {
+ auto& column = *_build_blocks[it->block_offset].get_by_position(idx->first).column;
+ _mutable_cols[idx->second]->insert_from(column, it->row_num);
+ }
+ block_size++;
+}
+
+template <bool is_intersect>
+Status VSetOperationNode<is_intersect>::sink_probe(RuntimeState* /*state*/, int child_id,
+ Block* block, bool eos) {
+ if (eos) {
+ _probe_finished_children_index[child_id] = true;
Review Comment:
the work may should do in finalize
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14868:
URL: https://github.com/apache/doris/pull/14868#issuecomment-1340330778
clang-tidy review says "All clean, LGTM! :+1:"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14868:
URL: https://github.com/apache/doris/pull/14868#issuecomment-1342863294
clang-tidy review says "All clean, LGTM! :+1:"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on code in PR #14868:
URL: https://github.com/apache/doris/pull/14868#discussion_r1043324246
##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -372,219 +376,252 @@ Status PipelineFragmentContext::_build_pipelines(ExecNode* node, PipelinePtr cur
RETURN_IF_ERROR(cur_pipe->add_operator(join_source));
cur_pipe->add_dependency(new_pipe);
+ case TPlanNodeType::INTERSECT_NODE: {
+ RETURN_IF_ERROR(_build_operators_for_set_operation_node<true>(node, cur_pipe));
+ break;
+ }
+ case TPlanNodeType::EXCEPT_NODE: {
+ RETURN_IF_ERROR(_build_operators_for_set_operation_node<false>(node, cur_pipe));
break;
}
default:
return Status::InternalError("Unsupported exec type in pipeline: {}",
print_plan_node_type(node_type));
}
- return Status::OK();
-}
+ return Status::OK();
+ }
+
+ template <bool is_intersect>
Review Comment:
warning: expected expression [clang-diagnostic-error]
```cpp
^
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14868:
URL: https://github.com/apache/doris/pull/14868#issuecomment-1340483173
clang-tidy review says "All clean, LGTM! :+1:"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] hello-stephen commented on pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #14868:
URL: https://github.com/apache/doris/pull/14868#issuecomment-1340337526
TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 35.52 seconds
load time: 429 seconds
storage size: 17123356317 Bytes
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20221207035613_clickbench_pr_59063.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on code in PR #14868:
URL: https://github.com/apache/doris/pull/14868#discussion_r1043322078
##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -372,219 +376,252 @@
RETURN_IF_ERROR(cur_pipe->add_operator(join_source));
cur_pipe->add_dependency(new_pipe);
+ case TPlanNodeType::INTERSECT_NODE: {
+ RETURN_IF_ERROR(_build_operators_for_set_operation_node<true>(node, cur_pipe));
+ break;
+ }
+ case TPlanNodeType::EXCEPT_NODE: {
Review Comment:
warning: cannot jump from switch statement to this case label [clang-diagnostic-error]
```cpp
}
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:373:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:368:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:366:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:365:** jump bypasses variable initialization
```cpp
{
^
```
##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -372,219 +376,252 @@
RETURN_IF_ERROR(cur_pipe->add_operator(join_source));
cur_pipe->add_dependency(new_pipe);
+ case TPlanNodeType::INTERSECT_NODE: {
+ RETURN_IF_ERROR(_build_operators_for_set_operation_node<true>(node, cur_pipe));
+ break;
+ }
+ case TPlanNodeType::EXCEPT_NODE: {
+ RETURN_IF_ERROR(_build_operators_for_set_operation_node<false>(node, cur_pipe));
break;
}
default:
return Status::InternalError("Unsupported exec type in pipeline: {}",
print_plan_node_type(node_type));
}
- return Status::OK();
-}
+ return Status::OK();
+ }
+
+ template <bool is_intersect>
Review Comment:
warning: expected expression [clang-diagnostic-error]
```cpp
^
```
##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -372,219 +376,252 @@
RETURN_IF_ERROR(cur_pipe->add_operator(join_source));
cur_pipe->add_dependency(new_pipe);
+ case TPlanNodeType::INTERSECT_NODE: {
+ RETURN_IF_ERROR(_build_operators_for_set_operation_node<true>(node, cur_pipe));
+ break;
+ }
+ case TPlanNodeType::EXCEPT_NODE: {
+ RETURN_IF_ERROR(_build_operators_for_set_operation_node<false>(node, cur_pipe));
break;
}
default:
Review Comment:
warning: cannot jump from switch statement to this case label [clang-diagnostic-error]
```cpp
}
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:373:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:368:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:366:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:365:** jump bypasses variable initialization
```cpp
{
^
```
##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -372,219 +376,252 @@ Status PipelineFragmentContext::_build_pipelines(ExecNode* node, PipelinePtr cur
RETURN_IF_ERROR(cur_pipe->add_operator(join_source));
cur_pipe->add_dependency(new_pipe);
+ case TPlanNodeType::INTERSECT_NODE: {
Review Comment:
warning: cannot jump from switch statement to this case label [clang-diagnostic-error]
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:373:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:368:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:366:** jump bypasses variable initialization
```cpp
;
^
```
**be/src/pipeline/pipeline_fragment_context.cpp:365:** jump bypasses variable initialization
```cpp
{
^
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14868:
URL: https://github.com/apache/doris/pull/14868#issuecomment-1343771636
PR approved by anyone and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] yiguolei merged pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #14868:
URL: https://github.com/apache/doris/pull/14868
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14868:
URL: https://github.com/apache/doris/pull/14868#issuecomment-1343771618
PR approved by at least one committer and no changes requested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] HappenLee commented on a diff in pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
HappenLee commented on code in PR #14868:
URL: https://github.com/apache/doris/pull/14868#discussion_r1043093424
##########
be/src/pipeline/pipeline_fragment_context.cpp:
##########
@@ -356,13 +360,46 @@ Status PipelineFragmentContext::_build_pipelines(ExecNode* node, PipelinePtr cur
RETURN_IF_ERROR(cur_pipe->add_operator(builder));
break;
}
+ case TPlanNodeType::INTERSECT_NODE: {
+ auto* intersect_node = assert_cast<vectorized::VSetOperationNode<true>*>(node);
Review Comment:
rethink we should do the `assert_cast` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on a diff in pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on code in PR #14868:
URL: https://github.com/apache/doris/pull/14868#discussion_r1041707251
##########
be/src/pipeline/exec/set_probe_sink_operator.h:
##########
@@ -0,0 +1,69 @@
+// 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 <utility>
+
+#include "operator.h"
+
+namespace doris {
+
+namespace vectorized {
+template <bool is_intersect>
+class VSetOperationNode;
+}
+
+namespace pipeline {
+
+template <bool is_intersect>
+class SetProbeSinkOperatorBuilder final
+ : public OperatorBuilder<vectorized::VSetOperationNode<is_intersect>> {
+private:
+ constexpr static auto builder_name =
+ is_intersect ? "IntersectProbeSinkOperatorBuilder" : "ExceptProbeSinkOperatorBuilder";
+
+public:
+ SetProbeSinkOperatorBuilder(int32_t id, int child_id,
+ vectorized::VSetOperationNode<is_intersect>* set_node);
+ bool is_sink() const override { return true; }
+
+ OperatorPtr build_operator() override;
+
+private:
+ int _child_id;
+};
+
+template <bool is_intersect>
+class SetProbeSinkOperator : public Operator<SetProbeSinkOperatorBuilder<is_intersect>> {
+public:
+ SetProbeSinkOperator(OperatorBuilderBase* operator_builder, int child_id,
+ vectorized::VSetOperationNode<is_intersect>* set_node);
+
+ bool can_write() override;
+
+ Status sink(RuntimeState* state, vectorized::Block* block, SourceState source_state) override;
+ Status finalize(RuntimeState* state) override;
+ Status open(RuntimeState* state) override { return Status::OK(); }
+ Status close(RuntimeState* state) override { return Status::OK(); }
Review Comment:
warning: parameter 'state' is unused [misc-unused-parameters]
```suggestion
Status close(RuntimeState* /*state*/) override { return Status::OK(); }
```
##########
be/src/pipeline/exec/set_probe_sink_operator.h:
##########
@@ -0,0 +1,69 @@
+// 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 <utility>
+
+#include "operator.h"
+
+namespace doris {
+
+namespace vectorized {
+template <bool is_intersect>
+class VSetOperationNode;
+}
+
+namespace pipeline {
+
+template <bool is_intersect>
+class SetProbeSinkOperatorBuilder final
+ : public OperatorBuilder<vectorized::VSetOperationNode<is_intersect>> {
+private:
+ constexpr static auto builder_name =
+ is_intersect ? "IntersectProbeSinkOperatorBuilder" : "ExceptProbeSinkOperatorBuilder";
+
+public:
+ SetProbeSinkOperatorBuilder(int32_t id, int child_id,
+ vectorized::VSetOperationNode<is_intersect>* set_node);
+ bool is_sink() const override { return true; }
+
+ OperatorPtr build_operator() override;
+
+private:
+ int _child_id;
+};
+
+template <bool is_intersect>
+class SetProbeSinkOperator : public Operator<SetProbeSinkOperatorBuilder<is_intersect>> {
+public:
+ SetProbeSinkOperator(OperatorBuilderBase* operator_builder, int child_id,
+ vectorized::VSetOperationNode<is_intersect>* set_node);
+
+ bool can_write() override;
+
+ Status sink(RuntimeState* state, vectorized::Block* block, SourceState source_state) override;
+ Status finalize(RuntimeState* state) override;
+ Status open(RuntimeState* state) override { return Status::OK(); }
Review Comment:
warning: parameter 'state' is unused [misc-unused-parameters]
```suggestion
Status open(RuntimeState* /*state*/) override { return Status::OK(); }
```
##########
be/src/vec/exec/vset_operation_node.h:
##########
@@ -31,34 +31,55 @@
namespace vectorized {
-class VSetOperationNode : public ExecNode {
+template <bool is_intersect>
+class VSetOperationNode final : public ExecNode {
public:
VSetOperationNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs);
- virtual Status init(const TPlanNode& tnode, RuntimeState* state = nullptr);
- virtual Status prepare(RuntimeState* state);
- virtual Status open(RuntimeState* state);
- virtual Status get_next(RuntimeState* state, RowBatch* row_batch, bool* eos) {
+ Status init(const TPlanNode& tnode, RuntimeState* state = nullptr) override;
+ Status prepare(RuntimeState* state) override;
+ Status open(RuntimeState* state) override;
+ Status get_next(RuntimeState* state, RowBatch* row_batch, bool* eos) override {
Review Comment:
warning: parameter 'eos' is unused [misc-unused-parameters]
```suggestion
Status get_next(RuntimeState* state, RowBatch* row_batch, bool* /*eos*/) override {
```
##########
be/src/vec/exec/vset_operation_node.h:
##########
@@ -31,34 +31,55 @@
namespace vectorized {
-class VSetOperationNode : public ExecNode {
+template <bool is_intersect>
+class VSetOperationNode final : public ExecNode {
public:
VSetOperationNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs);
- virtual Status init(const TPlanNode& tnode, RuntimeState* state = nullptr);
- virtual Status prepare(RuntimeState* state);
- virtual Status open(RuntimeState* state);
- virtual Status get_next(RuntimeState* state, RowBatch* row_batch, bool* eos) {
+ Status init(const TPlanNode& tnode, RuntimeState* state = nullptr) override;
+ Status prepare(RuntimeState* state) override;
+ Status open(RuntimeState* state) override;
+ Status get_next(RuntimeState* state, RowBatch* row_batch, bool* eos) override {
Review Comment:
warning: parameter 'row_batch' is unused [misc-unused-parameters]
```suggestion
Status get_next(RuntimeState* state, RowBatch* /*row_batch*/, bool* eos) override {
```
##########
be/src/pipeline/exec/set_sink_operator.h:
##########
@@ -0,0 +1,62 @@
+// 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 <utility>
+
+#include "operator.h"
+
+namespace doris {
+
+namespace vectorized {
+template <bool is_intersect>
+class VSetOperationNode;
+}
+
+namespace pipeline {
+
+template <bool is_intersect>
+class SetSinkOperatorBuilder final
+ : public OperatorBuilder<vectorized::VSetOperationNode<is_intersect>> {
+private:
+ constexpr static auto builder_name =
+ is_intersect ? "IntersectSinkOperatorBuilder" : "ExceptSinkOperatorBuilder";
+
+public:
+ SetSinkOperatorBuilder(int32_t id, ExecNode* set_node);
+ bool is_sink() const override { return true; }
+
+ OperatorPtr build_operator() override;
+};
+
+template <bool is_intersect>
+class SetSinkOperator : public Operator<SetSinkOperatorBuilder<is_intersect>> {
+public:
+ SetSinkOperator(OperatorBuilderBase* operator_builder,
+ vectorized::VSetOperationNode<is_intersect>* set_node);
+
+ bool can_write() override { return true; }
+
+ Status close(RuntimeState* state) override { return Status::OK(); };
Review Comment:
warning: parameter 'state' is unused [misc-unused-parameters]
```suggestion
Status close(RuntimeState* /*state*/) override { return Status::OK(); };
```
##########
be/src/pipeline/exec/set_source_operator.h:
##########
@@ -0,0 +1,57 @@
+// 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 <utility>
+
+#include "operator.h"
+
+namespace doris {
+
+namespace vectorized {
+template <bool is_intersect>
+class VSetOperationNode;
+}
+
+namespace pipeline {
+
+template <bool is_intersect>
+class SetSourceOperatorBuilder
+ : public OperatorBuilder<vectorized::VSetOperationNode<is_intersect>> {
+private:
+ constexpr static auto builder_name =
+ is_intersect ? "IntersectSourceOperatorBuilder" : "ExceptSourceOperatorBuilder";
+
+public:
+ SetSourceOperatorBuilder(int32_t id, ExecNode* set_node);
+ bool is_source() const override { return true; }
+
+ OperatorPtr build_operator() override;
+};
+
+template <bool is_intersect>
+class SetSourceOperator : public Operator<SetSourceOperatorBuilder<is_intersect>> {
+public:
+ SetSourceOperator(OperatorBuilderBase* builder,
+ vectorized::VSetOperationNode<is_intersect>* set_node);
+
+ Status open(RuntimeState* state) override { return Status::OK(); };
Review Comment:
warning: parameter 'state' is unused [misc-unused-parameters]
```suggestion
Status open(RuntimeState* /*state*/) override { return Status::OK(); };
```
##########
be/src/vec/exec/vset_operation_node.h:
##########
@@ -31,34 +31,55 @@ namespace doris {
namespace vectorized {
-class VSetOperationNode : public ExecNode {
+template <bool is_intersect>
+class VSetOperationNode final : public ExecNode {
public:
VSetOperationNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs);
- virtual Status init(const TPlanNode& tnode, RuntimeState* state = nullptr);
- virtual Status prepare(RuntimeState* state);
- virtual Status open(RuntimeState* state);
- virtual Status get_next(RuntimeState* state, RowBatch* row_batch, bool* eos) {
+ Status init(const TPlanNode& tnode, RuntimeState* state = nullptr) override;
+ Status prepare(RuntimeState* state) override;
+ Status open(RuntimeState* state) override;
+ Status get_next(RuntimeState* state, RowBatch* row_batch, bool* eos) override {
Review Comment:
warning: parameter 'state' is unused [misc-unused-parameters]
```suggestion
Status get_next(RuntimeState* /*state*/, RowBatch* row_batch, bool* eos) override {
```
##########
be/src/vec/exec/vset_operation_node.cpp:
##########
@@ -312,28 +433,73 @@ Status VSetOperationNode::process_build_block(Block& block, uint8_t offset) {
return Status::OK();
}
-Status VSetOperationNode::process_probe_block(RuntimeState* state, int child_id, bool* eos) {
- if (!_probe_column_inserted_id.empty()) {
- for (int j = 0; j < _probe_column_inserted_id.size(); ++j) {
- auto column_to_erase = _probe_column_inserted_id[j];
- _probe_block.erase(column_to_erase - j);
- }
- _probe_column_inserted_id.clear();
+template <bool is_intersect>
+void VSetOperationNode<is_intersect>::add_result_columns(RowRefListWithFlags& value,
+ int& block_size) {
+ auto it = value.begin();
+ for (auto idx = _build_col_idx.begin(); idx != _build_col_idx.end(); ++idx) {
+ auto& column = *_build_blocks[it->block_offset].get_by_position(idx->first).column;
+ _mutable_cols[idx->second]->insert_from(column, it->row_num);
+ }
+ block_size++;
+}
+
+template <bool is_intersect>
+Status VSetOperationNode<is_intersect>::sink_probe(RuntimeState* state, int child_id, Block* block,
Review Comment:
warning: parameter 'state' is unused [misc-unused-parameters]
```suggestion
Status VSetOperationNode<is_intersect>::sink_probe(RuntimeState* /*state*/, int child_id, Block* block,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14868:
URL: https://github.com/apache/doris/pull/14868#issuecomment-1340324558
clang-tidy review says "All clean, LGTM! :+1:"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] github-actions[bot] commented on pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #14868:
URL: https://github.com/apache/doris/pull/14868#issuecomment-1343752806
clang-tidy review says "All clean, LGTM! :+1:"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris] HappenLee commented on a diff in pull request #14868: [feature](pipeline) add inersect/except operators
Posted by GitBox <gi...@apache.org>.
HappenLee commented on code in PR #14868:
URL: https://github.com/apache/doris/pull/14868#discussion_r1043104790
##########
be/src/pipeline/pipeline_task.cpp:
##########
@@ -141,12 +141,11 @@ Status PipelineTask::execute(bool* eos) {
*eos = _data_state == SourceState::FINISHED;
if (_block->rows() != 0 || *eos) {
SCOPED_TIMER(_sink_timer);
- RETURN_IF_ERROR(_sink->sink(_state, block, _data_state));
+ _sink->sink(_state, block, _data_state);
Review Comment:
why not `RETURN_IF_ERROR`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org