public IEnumerable <KeyValuePair <string, ColumnType> > GetMetadataTypes(int col) { _ectx.Check(0 <= col && col < ColumnCount); if (!IsPivot(col)) { return(_inputSchema.GetMetadataTypes(col)); } return(_inputSchema.GetMetadataTypes(col).Where(pair => ShouldPreserveMetadata(pair.Key))); }
private static void ShowMetadata(IndentedTextWriter itw, Schema schema, int col, bool showVals) { Contracts.AssertValue(itw); Contracts.AssertValue(schema); Contracts.Assert(0 <= col && col < schema.ColumnCount); using (itw.Nest()) { foreach (var kvp in schema.GetMetadataTypes(col).OrderBy(p => p.Key)) { Contracts.AssertNonEmpty(kvp.Key); Contracts.AssertValue(kvp.Value); var type = kvp.Value; itw.Write("Metadata '{0}': {1}", kvp.Key, type); if (showVals) { if (!type.IsVector) { ShowMetadataValue(itw, schema, col, kvp.Key, type); } else { ShowMetadataValueVec(itw, schema, col, kvp.Key, type); } } itw.WriteLine(); } } }
public IEnumerable <KeyValuePair <string, ColumnType> > GetMetadataTypes(int col) { Contracts.CheckParam(0 <= col && col < ColumnCount, nameof(col)); return(_input.GetMetadataTypes(Sources[col])); }