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-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to