diff --git a/src/mito2/src/sst/index.rs b/src/mito2/src/sst/index.rs index b73bd0df7e..2fcfd8ee8c 100644 --- a/src/mito2/src/sst/index.rs +++ b/src/mito2/src/sst/index.rs @@ -52,39 +52,27 @@ pub struct IndexOutput { pub fulltext_index: FulltextIndexOutput, } +/// Base output of the index creation. +#[derive(Debug, Clone, Default)] +pub struct IndexBaseOutput { + /// Size of the index. + pub index_size: ByteCount, + /// Number of rows in the index. + pub row_count: RowCount, + /// Available columns in the index. + pub columns: Vec, +} + +impl IndexBaseOutput { + pub fn is_available(&self) -> bool { + self.index_size > 0 + } +} + /// Output of the inverted index creation. -#[derive(Debug, Clone, Default)] -pub struct InvertedIndexOutput { - /// Size of the index. - pub index_size: ByteCount, - /// Number of rows in the index. - pub row_count: RowCount, - /// Available columns in the index. - pub columns: Vec, -} - +pub type InvertedIndexOutput = IndexBaseOutput; /// Output of the fulltext index creation. -#[derive(Debug, Clone, Default)] -pub struct FulltextIndexOutput { - /// Size of the index. - pub index_size: ByteCount, - /// Number of rows in the index. - pub row_count: RowCount, - /// Available columns in the index. - pub columns: Vec, -} - -impl InvertedIndexOutput { - pub fn is_available(&self) -> bool { - self.index_size > 0 - } -} - -impl FulltextIndexOutput { - pub fn is_available(&self) -> bool { - self.index_size > 0 - } -} +pub type FulltextIndexOutput = IndexBaseOutput; /// The index creator that hides the error handling details. #[derive(Default)]