Skip to content

Commit 498dab7

Browse files
committed
fix
1 parent fcc46ae commit 498dab7

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/query/expression/src/block.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ impl DataBlock {
209209
&self.columns
210210
}
211211

212+
#[inline]
213+
pub fn take_columns(self) -> Vec<BlockEntry> {
214+
self.columns
215+
}
216+
212217
#[inline]
213218
pub fn columns_mut(&mut self) -> &mut [BlockEntry] {
214219
&mut self.columns

src/query/expression/src/converts/arrow/to.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ impl DataBlock {
227227
let mut arrays = Vec::with_capacity(self.columns().len());
228228
for (entry, arrow_field) in self
229229
.consume_convert_to_full()
230-
.columns()
231-
.iter()
230+
.take_columns()
231+
.into_iter()
232232
.zip(arrow_schema.fields())
233233
{
234-
let column = entry.value.to_owned().into_column().unwrap();
234+
let column = entry.value.into_column().unwrap();
235235
let column = column.maybe_gc();
236236
let array = column.into_arrow_rs();
237237

src/query/storages/fuse/src/io/write/block_writer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ pub fn serialize_block(
9797

9898
let block = block.consume_convert_to_full();
9999
let batch: Vec<Column> = block
100-
.columns()
101-
.iter()
102-
.map(|x| x.value.as_column().unwrap().clone())
100+
.take_columns()
101+
.into_iter()
102+
.map(|x| x.value.into_column().unwrap())
103103
.collect();
104104

105105
writer.start()?;

0 commit comments

Comments
 (0)