/// Create a partition summary from a collection of table summaries. These
/// summaries can come from many chunks so a table can appear multiple
/// times in the collection. They will be combined together for a single
/// summary. Field type conflicts will be ignored.
Create a partition summary from a collection of table summaries. These
summaries can come from many chunks so a table can appear multiple
times in the collection. They will be combined together for a single
summary. Field type conflicts will be ignored.
Create a partition summary from a collection of table summaries . These summaries can come from many chunks so a table can appear multiple times in the collection . They will be combined together for a single summary . Field type conflicts will be ignored .
pub fn from_table_summaries(
        key: impl Into<String>,
        summaries: impl IntoIterator<Item = TableSummary>,
    ) -> Self {
        let mut summaries: Vec<_> = summaries.into_iter().collect();
        summaries.sort_by(|a, b| a.name.cmp(&b.name));
        let mut tables = Vec::with_capacity(summaries.len());
        let mut summaries = summaries.into_iter();
        if let Some(mut table) = summaries.next() {
            for t in summaries {
                if table.name != t.name {
                    tables.push(table);
                    table = t;
                } else {
                    table.update_from(&t);
                }
            }
            tables.push(table);
        }
        Self {
            key: key.into(),
            tables,
        }
    }
pub fn from_table_summaries ( key : impl Into < String > , summaries : impl IntoIterator < Item = TableSummary > , ) -> Self { let mut summaries : Vec < _ > = summaries . into_iter ( ) . collect ( ) ; summaries . sort_by ( | a , b | a . name . cmp ( & b . name ) ) ; let mut tables = Vec :: with_capacity ( summaries . len ( ) ) ; let mut summaries = summaries . into_iter ( ) ; if let Some ( mut table ) = summaries . next ( ) { for t in summaries { if table . name != t . name { tables . push ( table ) ; table = t ; } else { table . update_from ( & t ) ; } } tables . push ( table ) ; } Self { key : key . into ( ) , tables , } }
Create a partition summary from a collection of table summaries.
Create a partition summary from a collection of table summaries .
key
impl Into<String>
summaries
impl IntoIterator<Item = TableSummary>