Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public StripeWriter(Type pocoType, Stream outputStream, bool shouldAlignNumericValues,
                            double uniqueStringThresholdRatio, int defaultDecimalPrecision, int defaultDecimalScale,
                            OrcCompressedBufferFactory bufferFactory, int strideLength, long stripeLength)
        {
            _typeName                   = pocoType.Name;
            _outputStream               = outputStream;
            _shouldAlignNumericValues   = shouldAlignNumericValues;
            _uniqueStringThresholdRatio = uniqueStringThresholdRatio;
            _defaultDecimalPrecision    = defaultDecimalPrecision;
            _defaultDecimalScale        = defaultDecimalScale;
            _bufferFactory              = bufferFactory;
            _strideLength               = strideLength;
            _stripeLength               = stripeLength;

            CreateColumnWriters(pocoType);
        }
Exemplo n.º 3
0
        public OrcWriter(Stream outputStream, WriterConfiguration configuration)
        {
            _outputStream = outputStream;

            _bufferFactory = new OrcCompressedBufferFactory(configuration);
            _stripeWriter  = new StripeWriter(
                typeof(T),
                outputStream,
                configuration.EncodingStrategy == EncodingStrategy.Speed,
                configuration.DictionaryKeySizeThreshold,
                configuration.DefaultDecimalPrecision,
                configuration.DefaultDecimalScale,
                _bufferFactory,
                configuration.RowIndexStride,
                configuration.StripeSize
                );

            WriteHeader();
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 //Assume all root values are present
 public StructWriter(OrcCompressedBufferFactory bufferFactory, uint columnId)
 {
     ColumnId = columnId;
 }