diff --git a/src/mito2/src/read.rs b/src/mito2/src/read.rs index 77e7ab5844d7..38a8f20d863f 100644 --- a/src/mito2/src/read.rs +++ b/src/mito2/src/read.rs @@ -56,7 +56,7 @@ impl Batch { fields: Vec, ) -> Result { BatchBuilder::new(primary_key, timestamps, sequences, op_types) - .fields(fields) + .with_fields(fields) .build() } @@ -124,7 +124,7 @@ impl BatchBuilder { } /// Set all field columns. - pub fn fields(&mut self, fields: Vec) -> &mut Self { + pub fn with_fields(mut self, fields: Vec) -> Self { self.fields = fields; self } diff --git a/src/mito2/src/sst/parquet/writer.rs b/src/mito2/src/sst/parquet/writer.rs index d53aee4ca3b4..b69196881439 100644 --- a/src/mito2/src/sst/parquet/writer.rs +++ b/src/mito2/src/sst/parquet/writer.rs @@ -80,9 +80,9 @@ impl<'a> ParquetWriter<'a> { let arrow_batch = RecordBatch::try_new( arrow_schema.clone(), batch - .columns + .fields() .iter() - .map(|v| v.to_arrow_array()) + .map(|v| v.data.to_arrow_array()) .collect::>(), ) .context(NewRecordBatchSnafu)?;