Skip to content

Conversation

@viirya
Copy link
Member

@viirya viirya commented Apr 16, 2024

Which issue does this PR close?

Closes #10093.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

fn sort_in_mem_batches(self: &mut Pin<&mut Self>) -> Result<RecordBatch> {
let input_batch = concat_batches(&self.schema(), &self.in_mem_batches)?;
self.in_mem_batches.clear();
println!("input_batch: {:?}", input_batch);
Copy link
Member

Choose a reason for hiding this comment

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

Looks like some debug logging that needs to be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, yea.

@alamb alamb changed the title fix: Specify row count in sort_batch for empty batch fix: Specify row count in sort_batch for batch with no columns Apr 16, 2024
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.

Seems good to me -- thanks @viirya

If the usecase is sorting a batch with 0 columns, I do wonder if that could be optimized away somehow.

@alamb alamb merged commit 1395adf into apache:main Apr 16, 2024
Omega359 pushed a commit to Omega359/arrow-datafusion that referenced this pull request Apr 16, 2024
@viirya
Copy link
Member Author

viirya commented Apr 16, 2024

Seems good to me -- thanks @viirya

If the usecase is sorting a batch with 0 columns, I do wonder if that could be optimized away somehow.

Yea, that's good idea. The physical query plan goes through Spark optimizer. It seems there is no corresponding optimization rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Got arrow error when sorting on empty batch

3 participants