Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore_result doesn't have an effect on union #16515

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/query/service/src/schedulers/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ use std::sync::Arc;
use async_trait::async_trait;
use databend_common_exception::Result;
use databend_common_expression::DataBlock;
use databend_common_pipeline_core::processors::ProcessorPtr;
use databend_common_pipeline_sinks::EmptySink;
use databend_common_sql::optimizer::QuerySampleExecutor;
use futures_util::TryStreamExt;

Expand Down Expand Up @@ -46,6 +48,11 @@ pub async fn build_query_pipeline(
if matches!(plan, PhysicalPlan::UnionAll { .. }) {
// Union doesn't need to add extra processor to project the result.
// It will be handled in union processor.
if ignore_result {
build_res
.main_pipeline
.add_sink(|input| Ok(ProcessorPtr::create(EmptySink::create(input))))?;
}
return Ok(build_res);
}
let input_schema = plan.output_schema()?;
Expand Down
5 changes: 5 additions & 0 deletions tests/sqllogictests/suites/query/union.test
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,8 @@ SELECT COUNT(1), 'numbers(10)' FROM numbers(10)

statement ok
unset max_set_operator_count;

query I
select * from numbers(100) union all select * from numbers(100) ignore_result;
----

Loading