diff --git a/be/src/runtime/result_writer.h b/be/src/runtime/result_writer.h index 302b014a72..a1458f1a71 100644 --- a/be/src/runtime/result_writer.h +++ b/be/src/runtime/result_writer.h @@ -25,6 +25,9 @@ namespace doris { +namespace vectorized { +class Block; +} class RuntimeState; // abstract class of the result writer @@ -42,6 +45,10 @@ public: virtual bool output_object_data() const { return _output_object_data; } + virtual Status append_block(vectorized::Block& block) = 0; + + virtual bool can_sink() { return true; } + void set_output_object_data(bool output_object_data) { _output_object_data = output_object_data; } diff --git a/be/src/vec/runtime/vfile_result_writer.h b/be/src/vec/runtime/vfile_result_writer.h index 1b9d58144f..4ec425755d 100644 --- a/be/src/vec/runtime/vfile_result_writer.h +++ b/be/src/vec/runtime/vfile_result_writer.h @@ -29,10 +29,10 @@ #include "common/status.h" #include "io/fs/file_writer.h" #include "runtime/descriptors.h" +#include "runtime/result_writer.h" #include "util/runtime_profile.h" #include "vec/core/block.h" #include "vec/runtime/vparquet_writer.h" -#include "vec/sink/vresult_writer.h" namespace doris { class BufferControlBlock; @@ -47,7 +47,7 @@ struct ResultFileOptions; namespace doris::vectorized { // write result to file -class VFileResultWriter final : public VResultWriter { +class VFileResultWriter final : public ResultWriter { public: VFileResultWriter(const ResultFileOptions* file_option, const TStorageBackendType::type storage_type, diff --git a/be/src/vec/sink/vmysql_result_writer.cpp b/be/src/vec/sink/vmysql_result_writer.cpp index 6c42403343..79bc099246 100644 --- a/be/src/vec/sink/vmysql_result_writer.cpp +++ b/be/src/vec/sink/vmysql_result_writer.cpp @@ -77,7 +77,7 @@ template VMysqlResultWriter::VMysqlResultWriter(BufferControlBlock* sinker, const VExprContextSPtrs& output_vexpr_ctxs, RuntimeProfile* parent_profile) - : VResultWriter(), + : ResultWriter(), _sinker(sinker), _output_vexpr_ctxs(output_vexpr_ctxs), _parent_profile(parent_profile) {} diff --git a/be/src/vec/sink/vmysql_result_writer.h b/be/src/vec/sink/vmysql_result_writer.h index dcd3f4dd54..b1954f2b01 100644 --- a/be/src/vec/sink/vmysql_result_writer.h +++ b/be/src/vec/sink/vmysql_result_writer.h @@ -24,11 +24,11 @@ #include "common/status.h" #include "runtime/define_primitive_type.h" +#include "runtime/result_writer.h" #include "util/mysql_row_buffer.h" #include "util/runtime_profile.h" #include "vec/data_types/data_type.h" #include "vec/exprs/vexpr_fwd.h" -#include "vec/sink/vresult_writer.h" namespace doris { class BufferControlBlock; @@ -38,7 +38,7 @@ namespace vectorized { class Block; template -class VMysqlResultWriter final : public VResultWriter { +class VMysqlResultWriter final : public ResultWriter { public: using ResultList = std::vector>; diff --git a/be/src/vec/sink/vresult_file_sink.cpp b/be/src/vec/sink/vresult_file_sink.cpp index 7f72c5c651..c5f4c0358e 100644 --- a/be/src/vec/sink/vresult_file_sink.cpp +++ b/be/src/vec/sink/vresult_file_sink.cpp @@ -37,7 +37,6 @@ #include "util/uid_util.h" #include "vec/exprs/vexpr.h" #include "vec/runtime/vfile_result_writer.h" -#include "vec/sink/vresult_writer.h" namespace doris { class QueryStatistics; diff --git a/be/src/vec/sink/vresult_file_sink.h b/be/src/vec/sink/vresult_file_sink.h index eaea995584..90bc06bb42 100644 --- a/be/src/vec/sink/vresult_file_sink.h +++ b/be/src/vec/sink/vresult_file_sink.h @@ -42,7 +42,6 @@ class TPlanFragmentDestination; class TResultFileSink; namespace vectorized { -class VResultWriter; class VExprContext; class VResultFileSink : public DataSink { @@ -84,7 +83,7 @@ private: std::unique_ptr _output_block = nullptr; std::shared_ptr _sender; std::unique_ptr _stream_sender; - std::shared_ptr _writer; + std::shared_ptr _writer; int _buf_size = 1024; // Allocated from _pool bool _is_top_sink = true; std::string _header; diff --git a/be/src/vec/sink/vresult_sink.cpp b/be/src/vec/sink/vresult_sink.cpp index 15b953cb1a..b14b5b0eeb 100644 --- a/be/src/vec/sink/vresult_sink.cpp +++ b/be/src/vec/sink/vresult_sink.cpp @@ -38,7 +38,6 @@ #include "vec/exprs/vexpr.h" #include "vec/exprs/vexpr_context.h" #include "vec/sink/vmysql_result_writer.h" -#include "vec/sink/vresult_writer.h" namespace doris { class QueryStatistics; diff --git a/be/src/vec/sink/vresult_sink.h b/be/src/vec/sink/vresult_sink.h index 93394930fb..de1126b2e1 100644 --- a/be/src/vec/sink/vresult_sink.h +++ b/be/src/vec/sink/vresult_sink.h @@ -29,13 +29,13 @@ #include "common/status.h" #include "exec/data_sink.h" #include "vec/exprs/vexpr_fwd.h" -#include "vec/sink/vresult_writer.h" namespace doris { class RuntimeState; class RuntimeProfile; class BufferControlBlock; class QueryStatistics; +class ResultWriter; class RowDescriptor; class TExpr; @@ -44,7 +44,6 @@ class ResultSinkOperator; } namespace vectorized { class Block; -class VResultWriter; struct ResultFileOptions { // [[deprecated]] @@ -155,7 +154,7 @@ private: VExprContextSPtrs _output_vexpr_ctxs; std::shared_ptr _sender; - std::shared_ptr _writer; + std::shared_ptr _writer; RuntimeProfile* _profile; // Allocated from _pool int _buf_size; // Allocated from _pool diff --git a/be/src/vec/sink/vresult_writer.h b/be/src/vec/sink/vresult_writer.h deleted file mode 100644 index 66c15e9cd6..0000000000 --- a/be/src/vec/sink/vresult_writer.h +++ /dev/null @@ -1,36 +0,0 @@ -// 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 "runtime/result_writer.h" - -namespace doris { -namespace vectorized { - -class Block; - -class VResultWriter : public ResultWriter { -public: - VResultWriter() : ResultWriter() {} - - virtual Status append_block(Block& block) = 0; - - virtual bool can_sink() { return true; } -}; -} // namespace vectorized -} // namespace doris