Skip to content

Commit

Permalink
feat: sort fields by column id
Browse files Browse the repository at this point in the history
  • Loading branch information
evenyag committed Aug 15, 2023
1 parent bbcf8ee commit 8cb4479
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mito2/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ pub struct Batch {
/// UInt8 type, not null.
op_types: Arc<UInt8Vector>,
/// Fields organized in columnar format.
///
/// Fields are ordered by their column id.
fields: Vec<BatchColumn>,
}

Expand Down Expand Up @@ -261,6 +263,8 @@ impl BatchBuilder {
}
);
}
// Sort fields by column id.
self.fields.sort_unstable_by_key(|field| field.column_id);

Ok(Batch {
primary_key: self.primary_key,
Expand Down

0 comments on commit 8cb4479

Please sign in to comment.