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 select from EmptyExec always return 0 row after optimizer passes #1938

Merged
merged 2 commits into from
Mar 7, 2022

Conversation

Ted-Jiang
Copy link
Member

@Ted-Jiang Ted-Jiang commented Mar 7, 2022

Which issue does this PR close?

Closes #1937.

Rationale for this change

What changes are included in this PR?

=== [Ef30eos/1/0] Physical plan with metrics ===
ShuffleWriterExec: None, metrics=[output_rows=0, input_rows=0, write_time=924.332µs]
  ProjectionExec: expr=[1 as Int64(1)], metrics=[output_rows=0, elapsed_compute=NOT RECORDED, spill_count=0, spilled_bytes=0, mem_used=0]
    EmptyExec: produce_one_row=false, metrics=[]

Executor always get EmptyExec: produce_one_row=false in select 1 ;

Are there any user-facing changes?

@github-actions github-actions bot added ballista datafusion Changes in the datafusion crate labels Mar 7, 2022
@@ -108,7 +108,10 @@ impl ExecutionPlan for EmptyExec {
children: Vec<Arc<dyn ExecutionPlan>>,
) -> Result<Arc<dyn ExecutionPlan>> {
match children.len() {
0 => Ok(Arc::new(EmptyExec::new(false, self.schema.clone()))),
0 => Ok(Arc::new(EmptyExec::new(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamb PTAL, If there i miss something for set false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice find @Ted-Jiang 👍

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- nice find @Ted-Jiang

@@ -108,7 +108,10 @@ impl ExecutionPlan for EmptyExec {
children: Vec<Arc<dyn ExecutionPlan>>,
) -> Result<Arc<dyn ExecutionPlan>> {
match children.len() {
0 => Ok(Arc::new(EmptyExec::new(false, self.schema.clone()))),
0 => Ok(Arc::new(EmptyExec::new(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice find @Ted-Jiang 👍

@alamb alamb merged commit d468177 into apache:master Mar 7, 2022
@alamb alamb changed the title Fix select from EmptyExec always return 0 row. Fix select from EmptyExec always return 0 row after optimizer passes Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ballista] select 1 won`t get result.
2 participants