Skip to content

Commit

Permalink
chore: apply review suggestion to spawn in pipeline init stage
Browse files Browse the repository at this point in the history
  • Loading branch information
dqhl76 committed Nov 1, 2024
1 parent 7f60492 commit c6f3fd1
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/query/storages/fuse/src/operations/read_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,23 +224,26 @@ impl FuseTable {
let table = self.clone();
let table_schema = self.schema_with_stream();
let push_downs = plan.push_downs.clone();
self.runtime.spawn(async move {
match table
.prune_snapshot_blocks(ctx, push_downs, table_schema, lazy_init_segments, 0)
.await
{
Ok((_, partitions)) => {
for part in partitions.partitions {
// ignore the error, the sql may be killed or early stop
let _ = sender.send(Ok(part)).await;
pipeline.set_on_init(move || {
table.runtime.clone().spawn(async move {
match table
.prune_snapshot_blocks(ctx, push_downs, table_schema, lazy_init_segments, 0)
.await
{
Ok((_, partitions)) => {
for part in partitions.partitions {
// ignore the error, the sql may be killed or early stop
let _ = sender.send(Ok(part)).await;
}
}
Err(err) => {
let _ = sender.send(Err(err)).await;
}
}
Err(err) => {
let _ = sender.send(Err(err)).await;
}
}
Ok::<_, ErrorCode>(())
});
Ok::<_, ErrorCode>(())
});
Ok(())
})
}

Ok(())
Expand Down

0 comments on commit c6f3fd1

Please sign in to comment.