Skip to content

Commit

Permalink
fix(batch): fix a bug of exchange and project. (#2545)
Browse files Browse the repository at this point in the history
fix(batch): fix the bug of exchange.
  • Loading branch information
likg227 authored May 16, 2022
1 parent f880b26 commit 523b669
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion e2e_test/v2/batch/tpch.slt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ include ../../batch/tpch/q17.slt.part
include ../../batch/tpch/q18.slt.part
include ../../batch/tpch/q19.slt.part
include ../../batch/tpch/q20.slt.part
# include ../../batch/tpch/q21.slt.part
include ../../batch/tpch/q21.slt.part

include ../../tpch/drop_tables.slt.part
6 changes: 5 additions & 1 deletion src/batch/src/executor2/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ impl ProjectExecutor2 {
.iter_mut()
.map(|expr| expr.eval(&data_chunk).map(Column::new))
.collect::<Result<Vec<_>>>()?;
let ret = DataChunk::builder().columns(arrays).build();
let ret = if arrays.is_empty() {
DataChunk::new_dummy(data_chunk.cardinality())
} else {
DataChunk::builder().columns(arrays).build()
};
yield ret
}
}
Expand Down
1 change: 1 addition & 0 deletions src/batch/src/task/hash_shuffle_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl ChanSender for HashShuffleSender {

impl HashShuffleSender {
async fn send_chunk(&mut self, chunk: DataChunk) -> Result<()> {
let chunk = chunk.compact()?;
let hash_values = generate_hash_values(&chunk, &self.hash_info)?;
let new_data_chunks = generate_new_data_chunks(&chunk, &self.hash_info, &hash_values)?;

Expand Down

0 comments on commit 523b669

Please sign in to comment.