Skip to content

Commit

Permalink
fix: take data block meta instead of clone
Browse files Browse the repository at this point in the history
  • Loading branch information
dqhl76 committed Nov 19, 2024
1 parent 713be70 commit c80b5b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ impl AsyncBlockPruneTransform {
impl AsyncAccumulatingTransform for AsyncBlockPruneTransform {
const NAME: &'static str = "AsyncBlockPruneTransform";

async fn transform(&mut self, data: DataBlock) -> Result<Option<DataBlock>> {
if let Some(ptr) = data.get_meta() {
if let Some(meta) = BlockMetasMeta::downcast_from(ptr.clone()) {
async fn transform(&mut self, mut data: DataBlock) -> Result<Option<DataBlock>> {
if let Some(ptr) = data.take_meta() {
if let Some(meta) = BlockMetasMeta::downcast_from(ptr) {
let block_meta_indexes =
self.block_pruner.internal_column_pruning(&meta.block_metas);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ impl AsyncSink for SendPartInfoSink {
Ok(())
}

async fn consume(&mut self, data_block: DataBlock) -> Result<bool> {
if let Some(meta) = data_block.get_meta() {
if let Some(data) = BlockPruneResult::downcast_ref_from(meta) {
async fn consume(&mut self, mut data_block: DataBlock) -> Result<bool> {
if let Some(meta) = data_block.take_meta() {
if let Some(data) = BlockPruneResult::downcast_from(meta) {
let arrow_schema = self.schema.as_ref().into();
let column_nodes = ColumnNodes::new_from_schema(&arrow_schema, Some(&self.schema));
let block_metas = &data.block_metas;
Expand All @@ -76,7 +76,7 @@ impl AsyncSink for SendPartInfoSink {
};

for info in info_ptr {
if let Some(sender) = &self.sender {
if let Some(sender) = &self.sender {
let _ = dbg!(sender.send(Ok(info)).await);
}
}
Expand Down

0 comments on commit c80b5b1

Please sign in to comment.