Exemplo n.º 1
0
        protected override void OnBeginFile()
        {
            // Switching to a new input file, so reset our read variables.
            var options = new Parquet.ParquetOptions();

            _pqReader          = new Parquet.ParquetReader(_reader.BaseStream);
            _pqDataFields      = _pqReader.Schema.GetDataFields();
            _rowGroupIndex     = 0;
            _rowGroupReadCount = 0;
            _rowGroupRowCount  = 0;
        }
Exemplo n.º 2
0
        protected override void OnBeginReading()
        {
            // Use Parquet.NET to do the heavy reading.
            var options = new Parquet.ParquetOptions();

            _pqReader     = new Parquet.ParquetReader(_reader.BaseStream);
            _pqDataFields = _pqReader.Schema.GetDataFields();

            // Extract the column names from the parquet file in a separate array for fast lookups.
            for (int i = 0; i < _pqDataFields.Length; i++)
            {
                var columnSchema = new ColumnSchema()
                {
                    ColumnName       = _pqDataFields[i].Name,
                    DataTypeName     = _pqDataFields[i].DataType.ToString(),
                    ColumnSize       = -1,
                    NumericPrecision = -1,
                    NumericScale     = -1,
                    AllowNull        = _pqDataFields[i].HasNulls
                };

                _columnSchema.Add(columnSchema);
            }
        }
Exemplo n.º 3
0
 public MetadataViewer(Parquet.ParquetReader parquetReader) : this()
 {
     this.parquetReader = parquetReader;
 }