@@ -47,7 +47,7 @@ namespace doris {
4747Status DataSink::create_data_sink (ObjectPool* pool, const TDataSink& thrift_sink,
4848 const std::vector<TExpr>& output_exprs,
4949 const TPlanFragmentExecParams& params,
50- const RowDescriptor& row_desc, bool is_vec ,
50+ const RowDescriptor& row_desc, RuntimeState* state ,
5151 std::unique_ptr<DataSink>* sink, DescriptorTbl& desc_tbl) {
5252 DataSink* tmp_sink = nullptr ;
5353
@@ -61,10 +61,10 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
6161 ? params.send_query_statistics_with_every_batch
6262 : false ;
6363 // TODO: figure out good buffer size based on size of output row
64- if (is_vec ) {
65- tmp_sink = new doris:: vectorized::VDataStreamSender (
66- pool, params.sender_id , row_desc, thrift_sink.stream_sink , params. destinations ,
67- 16 * 1024 , send_query_statistics_with_every_batch);
64+ if (state-> enable_vectorized_exec () ) {
65+ tmp_sink = new vectorized::VDataStreamSender (
66+ state, pool, params.sender_id , row_desc, thrift_sink.stream_sink ,
67+ params. destinations , 16 * 1024 , send_query_statistics_with_every_batch);
6868 } else {
6969 tmp_sink = new DataStreamSender (pool, params.sender_id , row_desc,
7070 thrift_sink.stream_sink , params.destinations , 16 * 1024 ,
@@ -80,7 +80,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
8080 }
8181
8282 // TODO: figure out good buffer size based on size of output row
83- if (is_vec ) {
83+ if (state-> enable_vectorized_exec () ) {
8484 tmp_sink = new doris::vectorized::VResultSink (row_desc, output_exprs,
8585 thrift_sink.result_sink , 4096 );
8686 } else {
@@ -95,7 +95,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
9595 }
9696
9797 // TODO: figure out good buffer size based on size of output row
98- if (is_vec ) {
98+ if (state-> enable_vectorized_exec () ) {
9999 bool send_query_statistics_with_every_batch =
100100 params.__isset .send_query_statistics_with_every_batch
101101 ? params.send_query_statistics_with_every_batch
@@ -139,7 +139,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
139139 if (!thrift_sink.__isset .mysql_table_sink ) {
140140 return Status::InternalError (" Missing data buffer sink." );
141141 }
142- if (is_vec ) {
142+ if (state-> enable_vectorized_exec () ) {
143143 doris::vectorized::VMysqlTableSink* vmysql_tbl_sink =
144144 new doris::vectorized::VMysqlTableSink (pool, row_desc, output_exprs);
145145 sink->reset (vmysql_tbl_sink);
@@ -158,7 +158,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
158158 if (!thrift_sink.__isset .odbc_table_sink ) {
159159 return Status::InternalError (" Missing data odbc sink." );
160160 }
161- if (is_vec ) {
161+ if (state-> enable_vectorized_exec () ) {
162162 sink->reset (new vectorized::VOdbcTableSink (pool, row_desc, output_exprs));
163163 } else {
164164 sink->reset (new OdbcTableSink (pool, row_desc, output_exprs));
@@ -170,7 +170,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
170170 if (!thrift_sink.__isset .jdbc_table_sink ) {
171171 return Status::InternalError (" Missing data jdbc sink." );
172172 }
173- if (is_vec ) {
173+ if (state-> enable_vectorized_exec () ) {
174174 if (config::enable_java_support) {
175175 sink->reset (new vectorized::VJdbcTableSink (pool, row_desc, output_exprs));
176176 } else {
@@ -196,7 +196,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
196196 case TDataSinkType::OLAP_TABLE_SINK : {
197197 Status status;
198198 DCHECK (thrift_sink.__isset .olap_table_sink );
199- if (is_vec ) {
199+ if (state-> enable_vectorized_exec () ) {
200200 sink->reset (new stream_load::VOlapTableSink (pool, row_desc, output_exprs, &status));
201201 } else {
202202 sink->reset (new stream_load::OlapTableSink (pool, row_desc, output_exprs, &status));
@@ -220,7 +220,7 @@ Status DataSink::create_data_sink(ObjectPool* pool, const TDataSink& thrift_sink
220220 }
221221 }
222222
223- if (sink-> get () != nullptr ) {
223+ if (* sink != nullptr ) {
224224 RETURN_IF_ERROR ((*sink)->init (thrift_sink));
225225 }
226226
0 commit comments