コード例 #1
0
ファイル: PrettyPrinter.cs プロジェクト: krippz/metaprint
        public void PrettyPrint(IEnumerable <string> files)
        {
            var builder  = new FileMetadataBuilder(files, _reader);
            var director = new FileMetadataInfoDirector(builder);

            director.BuildFileMetadataInfo(_verbose);

            var info = builder.GetMetadata();

            Wrap(info);

            Console.Write(info);
        }
コード例 #2
0
        /// <summary>
        /// Creates an instance of parquet writer on top of a stream
        /// </summary>
        /// <param name="output">Writeable, seekable stream</param>
        /// <param name="formatOptions">Additional options</param>
        /// <param name="writerOptions">The writer options.</param>
        /// <exception cref="ArgumentNullException">Output is null.</exception>
        /// <exception cref="ArgumentException">Output stream is not writeable</exception>
        public ParquetWriter(Stream output, ParquetOptions formatOptions = null, WriterOptions writerOptions = null) : base(output)
        {
            _output = output ?? throw new ArgumentNullException(nameof(output));
            if (!output.CanWrite)
            {
                throw new ArgumentException("stream is not writeable", nameof(output));
            }
            _formatOptions = formatOptions ?? new ParquetOptions();
            _writerOptions = writerOptions ?? new WriterOptions();
            _meta          = new FileMetadataBuilder(_writerOptions);

            _plainWriter = new PlainValuesWriter(_formatOptions);
            _rleWriter   = new RunLengthBitPackingHybridValuesWriter();
            _dicWriter   = new PlainDictionaryValuesWriter(_rleWriter);
        }
コード例 #3
0
        /// <summary>
        /// Creates an instance of parquet writer on top of a stream
        /// </summary>
        /// <param name="output">Writeable, seekable stream</param>
        /// <param name="formatOptions">Additional options</param>
        /// <param name="writerOptions">The writer options.</param>
        /// <exception cref="ArgumentNullException">Output is null.</exception>
        /// <exception cref="ArgumentException">Output stream is not writeable</exception>
        public ParquetWriter(Stream output, ParquetOptions formatOptions = null, WriterOptions writerOptions = null)
            : base(new PositionTrackingStream(output))
        {
            if (output == null)
            {
                throw new ArgumentNullException(nameof(output));
            }

            if (!output.CanWrite)
            {
                throw new ArgumentException("stream is not writeable", nameof(output));
            }
            _formatOptions = formatOptions ?? new ParquetOptions();
            _writerOptions = writerOptions ?? new WriterOptions();
            _meta          = new FileMetadataBuilder();
        }