This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 89eacd4751 [enhancement](load) support dry_run_query for load (#23680) 89eacd4751 is described below commit 89eacd47515b256e95a371ab6950efb3c24b2e87 Author: Yongqiang YANG <98214048+dataroar...@users.noreply.github.com> AuthorDate: Sun Sep 3 15:08:10 2023 +0800 [enhancement](load) support dry_run_query for load (#23680) If dry_run_query is set, a sink just discards blocks and do not send them to destination. --- be/src/vec/sink/vtablet_sink.cpp | 4 ++++ be/src/vec/sink/vtablet_sink_v2.cpp | 4 ++++ docs/en/docs/advanced/variables.md | 2 +- docs/zh-CN/docs/advanced/variables.md | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/be/src/vec/sink/vtablet_sink.cpp b/be/src/vec/sink/vtablet_sink.cpp index 02782a8220..09bcdc6e25 100644 --- a/be/src/vec/sink/vtablet_sink.cpp +++ b/be/src/vec/sink/vtablet_sink.cpp @@ -1297,6 +1297,10 @@ Status VOlapTableSink::send(RuntimeState* state, vectorized::Block* input_block, SCOPED_CONSUME_MEM_TRACKER(_mem_tracker.get()); Status status = Status::OK(); + if (state->query_options().dry_run_query) { + return status; + } + auto rows = input_block->rows(); auto bytes = input_block->bytes(); if (UNLIKELY(rows == 0)) { diff --git a/be/src/vec/sink/vtablet_sink_v2.cpp b/be/src/vec/sink/vtablet_sink_v2.cpp index eb66eac664..a88f05b88d 100644 --- a/be/src/vec/sink/vtablet_sink_v2.cpp +++ b/be/src/vec/sink/vtablet_sink_v2.cpp @@ -248,6 +248,10 @@ Status VOlapTableSinkV2::send(RuntimeState* state, vectorized::Block* input_bloc SCOPED_CONSUME_MEM_TRACKER(_mem_tracker.get()); Status status = Status::OK(); + if (state->query_options().dry_run_query) { + return status; + } + auto input_rows = input_block->rows(); auto input_bytes = input_block->bytes(); if (UNLIKELY(input_rows == 0)) { diff --git a/docs/en/docs/advanced/variables.md b/docs/en/docs/advanced/variables.md index f2838dde23..d77c1f06ed 100644 --- a/docs/en/docs/advanced/variables.md +++ b/docs/en/docs/advanced/variables.md @@ -646,7 +646,7 @@ Translated with www.DeepL.com/Translator (free version) <version since="dev"></version> - If set to true, for query requests, the actual result set will no longer be returned, but only the number of rows. The default is false. + If set to true, for query requests, the actual result set will no longer be returned, but only the number of rows, while for load and insert, the data is discarded by sink node, no writing happens. The default is false. This parameter can be used to avoid the time-consuming result set transmission when testing a large number of data sets, and focus on the time-consuming underlying query execution. diff --git a/docs/zh-CN/docs/advanced/variables.md b/docs/zh-CN/docs/advanced/variables.md index 4587f86e81..6302ea604e 100644 --- a/docs/zh-CN/docs/advanced/variables.md +++ b/docs/zh-CN/docs/advanced/variables.md @@ -633,7 +633,7 @@ try (Connection conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:9030/ <version since="dev"></version> - 如果设置为true,对于查询请求,将不再返回实际结果集,而仅返回行数。默认为 false。 + 如果设置为true,对于查询请求,将不再返回实际结果集,而仅返回行数。对于导入和insert,Sink 丢掉了数据,不会有实际的写发生。额默认为 false。 该参数可以用于测试返回大量数据集时,规避结果集传输的耗时,重点关注底层查询执行的耗时。 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org