예제 #1
0
        public ColumnStats GetColumnStats(SchemaElement schema)
        {
            if (_schemaToStats.TryGetValue(schema, out ColumnStats result))
            {
                return(result);
            }

            ColumnStats stats = CalculateStats(schema);

            _schemaToStats[schema] = stats;

            return(stats);
        }
예제 #2
0
        private ColumnStats CalculateStats(SchemaElement schema)
        {
            int index = _ds.Schema.GetElementIndex(schema);
            var stats = new ColumnStats();

            foreach (object value in _ds.GetColumn(index))
            {
                if (value == null)
                {
                    stats.NullCount += 1;
                }
            }

            return(stats);
        }