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 c619a17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mito2/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ pub struct Batch {
/// UInt8 type, not null.
op_types: Arc<UInt8Vector>,
/// Fields organized in columnar format.
///
/// Fields are ordered by their column id so the batch after projection
/// is always consistent.
fields: Vec<BatchColumn>,
}

Expand Down Expand Up @@ -261,6 +264,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 c619a17

Please sign in to comment.