示例#1
0
        public BinaryWriter(bool shouldAlignLengths, OrcCompressedBufferFactory bufferFactory, uint columnId)
        {
            _shouldAlignLengths = shouldAlignLengths;
            ColumnId            = columnId;

            _presentBuffer = bufferFactory.CreateBuffer(StreamKind.Present);
            _presentBuffer.MustBeIncluded = false;
            _dataBuffer   = bufferFactory.CreateBuffer(StreamKind.Data);
            _lengthBuffer = bufferFactory.CreateBuffer(StreamKind.Length);
        }
示例#2
0
        public static void AddDataStream(this StripeFooter footer, uint columnId, OrcCompressedBuffer buffer)
        {
            var stream = new Protocol.Stream
            {
                Column = columnId,
                Kind   = buffer.StreamKind,
                Length = (ulong)buffer.Length
            };

            footer.Streams.Add(stream);
        }
示例#3
0
        public DoubleWriter(bool isNullable, OrcCompressedBufferFactory bufferFactory, uint columnId)
        {
            _isNullable = isNullable;
            ColumnId    = columnId;

            if (_isNullable)
            {
                _presentBuffer = bufferFactory.CreateBuffer(StreamKind.Present);
                _presentBuffer.MustBeIncluded = false;
            }
            _dataBuffer = bufferFactory.CreateBuffer(StreamKind.Data);
        }
示例#4
0
        public DateWriter(bool isNullable, bool shouldAlignEncodedValues, OrcCompressedBufferFactory bufferFactory, uint columnId)
        {
            _isNullable = isNullable;
            _shouldAlignEncodedValues = shouldAlignEncodedValues;
            ColumnId = columnId;

            if (_isNullable)
            {
                _presentBuffer = bufferFactory.CreateBuffer(StreamKind.Present);
                _presentBuffer.MustBeIncluded = false;
            }
            _dataBuffer = bufferFactory.CreateBuffer(StreamKind.Data);
        }
示例#5
0
        public LongWriter(bool isNullable, bool shouldAlignEncodedValues, OrcCompressedBufferFactory bufferFactory, uint columnId)
        {
            _isNullable = isNullable;
            _shouldAlignEncodedValues = shouldAlignEncodedValues;
            ColumnId = columnId;

            if (_isNullable)
            {
                _presentBuffer = bufferFactory.CreateBuffer(StreamKind.Present);
                _presentBuffer.MustBeIncluded = false;                           //If we never have nulls, we won't write this stream
            }
            _dataBuffer = bufferFactory.CreateBuffer(StreamKind.Data);
        }
        public StringWriter(bool shouldAlignLengths, bool shouldAlignDictionaryLookup, double uniqueStringThresholdRatio, long strideLength, OrcCompressedBufferFactory bufferFactory, uint columnId)
        {
            _shouldAlignLengths          = shouldAlignLengths;
            _shouldAlignDictionaryLookup = shouldAlignDictionaryLookup;
            _uniqueStringThresholdRatio  = uniqueStringThresholdRatio;
            _strideLength = strideLength;
            ColumnId      = columnId;

            _presentBuffer = bufferFactory.CreateBuffer(StreamKind.Present);
            _presentBuffer.MustBeIncluded = false;
            _dataBuffer           = bufferFactory.CreateBuffer(StreamKind.Data);
            _lengthBuffer         = bufferFactory.CreateBuffer(StreamKind.Length);
            _dictionaryDataBuffer = bufferFactory.CreateBuffer(StreamKind.DictionaryData);
        }
        public DecimalWriter(bool isNullable, bool shouldAlignEncodedValues, int precision, int scale, OrcCompressedBufferFactory bufferFactory, uint columnId)
        {
            _isNullable = isNullable;
            _shouldAlignEncodedValues = shouldAlignEncodedValues;
            _scale   = scale;
            ColumnId = columnId;

            if (precision > 18)
            {
                throw new NotSupportedException("This implementation of DecimalWriter does not support precision greater than 18 digits (2^63)");
            }

            if (_isNullable)
            {
                _presentBuffer = bufferFactory.CreateBuffer(StreamKind.Present);
                _presentBuffer.MustBeIncluded = false;
            }
            _dataBuffer      = bufferFactory.CreateBuffer(StreamKind.Data);
            _secondaryBuffer = bufferFactory.CreateBuffer(StreamKind.Secondary);
        }