void SysStatsAddOrUpdate(string tabcol, ColumnStat stat) { if (RetrieveColumnStat(tabcol) is null) { records_.Add(tabcol, stat); } else { records_[tabcol] = stat; } }
public void jsonPostProcess(ColumnStat stat) { if (stat.hist_ != null) { for (int i = 0; i < stat.hist_.buckets_.Length; i++) { stat.hist_.buckets_[i] = ExtractValue((JsonElement)stat.hist_.buckets_[i]); } } if (stat.mcv_ != null && stat.mcv_.nvalues_ != 0) { int i = 0; while (stat.mcv_.values_[i] != null) { stat.mcv_.values_[i] = ExtractValue((JsonElement)stat.mcv_.values_[i]); i++; } } }
public List <ColumnStat> GetOrCreateTableStats(string tabName) { var table = Catalog.systable_.Table(tabName); var columns = table.columns_; List <ColumnStat> stats = new List <ColumnStat>(); foreach (var v in columns) { var colName = v.Value.name_; var stat = GetColumnStat(tabName, colName); if (stat is null) { stat = new ColumnStat(); AddOrUpdate(tabName, colName, stat); } stats.Add(stat); } Debug.Assert(stats.Count == columns.Count); return(stats); }
public void AddOrUpdate(string tabName, string colName, ColumnStat stat) { string tabcol = tabName + colName; SysStatsAddOrUpdate(tabcol, stat); }