예제 #1
0
 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)));
 }
예제 #2
0
        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();
                }
            }
        }
예제 #3
0
 public IEnumerable <KeyValuePair <string, ColumnType> > GetMetadataTypes(int col)
 {
     Contracts.CheckParam(0 <= col && col < ColumnCount, nameof(col));
     return(_input.GetMetadataTypes(Sources[col]));
 }