/// public static Matrix ReadMatrix(IValuesReader reader) { var size = reader.GetMatrixSize(); var hasRead = 0; var matrixRows = new List <MatrixRow>(size.Item1); var elements = new List <int>(size.Item2); while (reader.HasNext()) { var element = reader.ReadNext(); elements.Add(element); ++hasRead; if (hasRead == size.Item2) { matrixRows.Add(new MatrixRow { Elements = elements.ToArray() }); elements.Clear(); hasRead = 0; } } return(new Matrix { Rows = matrixRows.ToArray() }); }
public PColumn(Thrift.ColumnChunk thriftChunk, SchemaElement schema, Stream inputStream, ThriftStream thriftStream, ParquetOptions options) { _thriftChunk = thriftChunk; _thrift = thriftStream; _schema = schema; _inputStream = inputStream; _options = options; _plainReader = new PlainValuesReader(options); }
public PlainValuesReaderWriterTest() { _options = new ParquetOptions(); _reader = new PlainValuesReader(_options); _writer = new PlainValuesWriter(_options); _ms = new MemoryStream(); _br = new BinaryReader(_ms); _bw = new BinaryWriter(_ms); }
public PColumn(Thrift.ColumnChunk thriftChunk, Schema schema, Stream inputStream, ThriftStream thriftStream, ParquetOptions options) { if (thriftChunk.Meta_data.Path_in_schema.Count != 1) { throw new NotImplementedException("path in scheme is not flat"); } _thriftChunk = thriftChunk; _thrift = thriftStream; _schema = schema; _inputStream = inputStream; _schemaElement = _schema[_thriftChunk]; _options = options; _plainReader = new PlainValuesReader(options); }