Documentation ¶
Overview ¶
Package encoding provides the generic APIs implemented by parquet encodings in its sub-packages.
Index ¶
- Constants
- Variables
- func CanEncodeBoolean(e Encoding) bool
- func CanEncodeByteArray(e Encoding) bool
- func CanEncodeDouble(e Encoding) bool
- func CanEncodeFixedLenByteArray(e Encoding) bool
- func CanEncodeFloat(e Encoding) bool
- func CanEncodeInt32(e Encoding) bool
- func CanEncodeInt64(e Encoding) bool
- func CanEncodeInt96(e Encoding) bool
- func CanEncodeLevels(e Encoding) bool
- func EncodeBoolean(dst []byte, src Values, enc Encoding) ([]byte, error)
- func EncodeByteArray(dst []byte, src Values, enc Encoding) ([]byte, error)
- func EncodeDouble(dst []byte, src Values, enc Encoding) ([]byte, error)
- func EncodeFixedLenByteArray(dst []byte, src Values, enc Encoding) ([]byte, error)
- func EncodeFloat(dst []byte, src Values, enc Encoding) ([]byte, error)
- func EncodeInt32(dst []byte, src Values, enc Encoding) ([]byte, error)
- func EncodeInt64(dst []byte, src Values, enc Encoding) ([]byte, error)
- func EncodeInt96(dst []byte, src Values, enc Encoding) ([]byte, error)
- func ErrDecodeInvalidInputSize(e Encoding, typ string, size int) error
- func ErrEncodeInvalidInputSize(e Encoding, typ string, size int) error
- func Error(e Encoding, err error) error
- func Errorf(e Encoding, msg string, args ...interface{}) error
- type Encoding
- type Kind
- type NotSupported
- func (NotSupported) CanDecodeInPlace() bool
- func (NotSupported) DecodeBoolean(dst []byte, src []byte) ([]byte, error)
- func (NotSupported) DecodeByteArray(dst []byte, src []byte, offsets []uint32) ([]byte, []uint32, error)
- func (NotSupported) DecodeDouble(dst []float64, src []byte) ([]float64, error)
- func (NotSupported) DecodeFixedLenByteArray(dst []byte, src []byte, size int) ([]byte, error)
- func (NotSupported) DecodeFloat(dst []float32, src []byte) ([]float32, error)
- func (NotSupported) DecodeInt32(dst []int32, src []byte) ([]int32, error)
- func (NotSupported) DecodeInt64(dst []int64, src []byte) ([]int64, error)
- func (NotSupported) DecodeInt96(dst []deprecated.Int96, src []byte) ([]deprecated.Int96, error)
- func (NotSupported) DecodeLevels(dst []uint8, src []byte) ([]uint8, error)
- func (NotSupported) EncodeBoolean(dst []byte, src []byte) ([]byte, error)
- func (NotSupported) EncodeByteArray(dst []byte, src []byte, offsets []uint32) ([]byte, error)
- func (NotSupported) EncodeDouble(dst []byte, src []float64) ([]byte, error)
- func (NotSupported) EncodeFixedLenByteArray(dst []byte, src []byte, size int) ([]byte, error)
- func (NotSupported) EncodeFloat(dst []byte, src []float32) ([]byte, error)
- func (NotSupported) EncodeInt32(dst []byte, src []int32) ([]byte, error)
- func (NotSupported) EncodeInt64(dst []byte, src []int64) ([]byte, error)
- func (NotSupported) EncodeInt96(dst []byte, src []deprecated.Int96) ([]byte, error)
- func (NotSupported) EncodeLevels(dst []byte, src []uint8) ([]byte, error)
- func (NotSupported) Encoding() format.Encoding
- func (NotSupported) EstimateDecodeByteArraySize(src []byte) int
- func (NotSupported) String() string
- type Values
- func BooleanValues(values []byte) Values
- func ByteArrayValues(values []byte, offsets []uint32) Values
- func DecodeBoolean(dst Values, src []byte, enc Encoding) (Values, error)
- func DecodeByteArray(dst Values, src []byte, enc Encoding) (Values, error)
- func DecodeDouble(dst Values, src []byte, enc Encoding) (Values, error)
- func DecodeFixedLenByteArray(dst Values, src []byte, enc Encoding) (Values, error)
- func DecodeFloat(dst Values, src []byte, enc Encoding) (Values, error)
- func DecodeInt32(dst Values, src []byte, enc Encoding) (Values, error)
- func DecodeInt64(dst Values, src []byte, enc Encoding) (Values, error)
- func DecodeInt96(dst Values, src []byte, enc Encoding) (Values, error)
- func DoubleValues(values []float64) Values
- func DoubleValuesFromBytes(values []byte) Values
- func FixedLenByteArrayValues(values []byte, size int) Values
- func FloatValues(values []float32) Values
- func FloatValuesFromBytes(values []byte) Values
- func Int32Values(values []int32) Values
- func Int32ValuesFromBytes(values []byte) Values
- func Int64Values(values []int64) Values
- func Int64ValuesFromBytes(values []byte) Values
- func Int96Values(values []deprecated.Int96) Values
- func Int96ValuesFromBytes(values []byte) Values
- func Uint128Values(values [][16]byte) Values
- func Uint32Values(values []uint32) Values
- func Uint64Values(values []uint64) Values
- func (v *Values) Boolean() []byte
- func (v *Values) ByteArray() (data []byte, offsets []uint32)
- func (v *Values) Data() (data []byte, offsets []uint32)
- func (v *Values) Double() []float64
- func (v *Values) FixedLenByteArray() (data []byte, size int)
- func (v *Values) Float() []float32
- func (v *Values) Int32() []int32
- func (v *Values) Int64() []int64
- func (v *Values) Int96() []deprecated.Int96
- func (v *Values) Kind() Kind
- func (v *Values) Size() int64
- func (v *Values) Uint128() [][16]byte
- func (v *Values) Uint32() []uint32
- func (v *Values) Uint64() []uint64
Constants ¶
const (
MaxFixedLenByteArraySize = math.MaxInt16
)
Variables ¶
var ( // ErrNotSupported is an error returned when the underlying encoding does // not support the type of values being encoded or decoded. // // This error may be wrapped with type information, applications must use // errors.Is rather than equality comparisons to test the error values // returned by encoders and decoders. ErrNotSupported = errors.New("encoding not supported") // ErrInvalidArgument is an error returned one or more arguments passed to // the encoding functions are incorrect. // // As with ErrNotSupported, this error may be wrapped with specific // information about the problem and applications are expected to use // errors.Is for comparisons. ErrInvalidArgument = errors.New("invalid argument") )
Functions ¶
func CanEncodeBoolean ¶
CanEncodeBoolean reports whether e can encode BOOLEAN values.
func CanEncodeByteArray ¶
CanEncodeByteArray reports whether e can encode BYTE_ARRAY values.
func CanEncodeDouble ¶
CanEncodeDouble reports whether e can encode DOUBLE values.
func CanEncodeFixedLenByteArray ¶
CanEncodeFixedLenByteArray reports whether e can encode FIXED_LEN_BYTE_ARRAY values.
func CanEncodeFloat ¶
CanEncodeFloat reports whether e can encode FLOAT values.
func CanEncodeInt32 ¶
CanEncodeInt32 reports whether e can encode INT32 values.
func CanEncodeInt64 ¶
CanEncodeInt64 reports whether e can encode INT64 values.
func CanEncodeInt96 ¶
CanEncodeInt96 reports whether e can encode INT96 values.
func CanEncodeLevels ¶
CanEncodeInt8 reports whether e can encode LEVELS values.
func EncodeFixedLenByteArray ¶
func ErrDecodeInvalidInputSize ¶
ErrDecodeInvalidInputSize constructs an error indicating that decoding failed due to the size of the input.
func ErrEncodeInvalidInputSize ¶
ErrEncodeInvalidInputSize constructs an error indicating that encoding failed due to the size of the input.
Types ¶
type Encoding ¶
type Encoding interface { // Returns a human-readable name for the encoding. String() string // Returns the parquet code representing the encoding. Encoding() format.Encoding // Encode methods serialize the source sequence of values into the // destination buffer, potentially reallocating it if it was too short to // contain the output. // // The methods panic if the type of src values differ from the type of // values being encoded. EncodeLevels(dst []byte, src []uint8) ([]byte, error) EncodeBoolean(dst []byte, src []byte) ([]byte, error) EncodeInt32(dst []byte, src []int32) ([]byte, error) EncodeInt64(dst []byte, src []int64) ([]byte, error) EncodeInt96(dst []byte, src []deprecated.Int96) ([]byte, error) EncodeFloat(dst []byte, src []float32) ([]byte, error) EncodeDouble(dst []byte, src []float64) ([]byte, error) EncodeByteArray(dst []byte, src []byte, offsets []uint32) ([]byte, error) EncodeFixedLenByteArray(dst []byte, src []byte, size int) ([]byte, error) // Decode methods deserialize from the source buffer into the destination // slice, potentially growing it if it was too short to contain the result. // // The methods panic if the type of dst values differ from the type of // values being decoded. DecodeLevels(dst []uint8, src []byte) ([]uint8, error) DecodeBoolean(dst []byte, src []byte) ([]byte, error) DecodeInt32(dst []int32, src []byte) ([]int32, error) DecodeInt64(dst []int64, src []byte) ([]int64, error) DecodeInt96(dst []deprecated.Int96, src []byte) ([]deprecated.Int96, error) DecodeFloat(dst []float32, src []byte) ([]float32, error) DecodeDouble(dst []float64, src []byte) ([]float64, error) DecodeByteArray(dst []byte, src []byte, offsets []uint32) ([]byte, []uint32, error) DecodeFixedLenByteArray(dst []byte, src []byte, size int) ([]byte, error) // Computes an estimation of the output size of decoding the encoded page // of values passed as argument. // // Note that this is an estimate, it is useful to preallocate the output // buffer that will be passed to the decode method, but the actual output // size may be different. // // The estimate never errors since it is not intended to be used as an // input validation method. EstimateDecodeByteArraySize(src []byte) int // When this method returns true, the encoding supports receiving the same // buffer as source and destination. CanDecodeInPlace() bool }
The Encoding interface is implemented by types representing parquet column encodings.
Encoding instances must be safe to use concurrently from multiple goroutines.
type NotSupported ¶
type NotSupported struct { }
NotSupported is a type satisfying the Encoding interface which does not support encoding nor decoding any value types.
func (NotSupported) CanDecodeInPlace ¶
func (NotSupported) CanDecodeInPlace() bool
func (NotSupported) DecodeBoolean ¶
func (NotSupported) DecodeBoolean(dst []byte, src []byte) ([]byte, error)
func (NotSupported) DecodeByteArray ¶
func (NotSupported) DecodeDouble ¶
func (NotSupported) DecodeDouble(dst []float64, src []byte) ([]float64, error)
func (NotSupported) DecodeFixedLenByteArray ¶
func (NotSupported) DecodeFloat ¶
func (NotSupported) DecodeFloat(dst []float32, src []byte) ([]float32, error)
func (NotSupported) DecodeInt32 ¶
func (NotSupported) DecodeInt32(dst []int32, src []byte) ([]int32, error)
func (NotSupported) DecodeInt64 ¶
func (NotSupported) DecodeInt64(dst []int64, src []byte) ([]int64, error)
func (NotSupported) DecodeInt96 ¶
func (NotSupported) DecodeInt96(dst []deprecated.Int96, src []byte) ([]deprecated.Int96, error)
func (NotSupported) DecodeLevels ¶
func (NotSupported) DecodeLevels(dst []uint8, src []byte) ([]uint8, error)
func (NotSupported) EncodeBoolean ¶
func (NotSupported) EncodeBoolean(dst []byte, src []byte) ([]byte, error)
func (NotSupported) EncodeByteArray ¶
func (NotSupported) EncodeDouble ¶
func (NotSupported) EncodeDouble(dst []byte, src []float64) ([]byte, error)
func (NotSupported) EncodeFixedLenByteArray ¶
func (NotSupported) EncodeFloat ¶
func (NotSupported) EncodeFloat(dst []byte, src []float32) ([]byte, error)
func (NotSupported) EncodeInt32 ¶
func (NotSupported) EncodeInt32(dst []byte, src []int32) ([]byte, error)
func (NotSupported) EncodeInt64 ¶
func (NotSupported) EncodeInt64(dst []byte, src []int64) ([]byte, error)
func (NotSupported) EncodeInt96 ¶
func (NotSupported) EncodeInt96(dst []byte, src []deprecated.Int96) ([]byte, error)
func (NotSupported) EncodeLevels ¶
func (NotSupported) EncodeLevels(dst []byte, src []uint8) ([]byte, error)
func (NotSupported) Encoding ¶
func (NotSupported) Encoding() format.Encoding
func (NotSupported) EstimateDecodeByteArraySize ¶
func (NotSupported) EstimateDecodeByteArraySize(src []byte) int
func (NotSupported) String ¶
func (NotSupported) String() string
type Values ¶
type Values struct {
// contains filtered or unexported fields
}
func BooleanValues ¶
func ByteArrayValues ¶
func DecodeFixedLenByteArray ¶
func DoubleValues ¶
func DoubleValuesFromBytes ¶
func FixedLenByteArrayValues ¶
func FloatValues ¶
func FloatValuesFromBytes ¶
func Int32Values ¶
func Int32ValuesFromBytes ¶
func Int64Values ¶
func Int64ValuesFromBytes ¶
func Int96Values ¶
func Int96Values(values []deprecated.Int96) Values
func Int96ValuesFromBytes ¶
func Uint128Values ¶
func Uint32Values ¶
func Uint64Values ¶
func (*Values) FixedLenByteArray ¶
func (*Values) Int96 ¶
func (v *Values) Int96() []deprecated.Int96
Directories ¶
Path | Synopsis |
---|---|
Package fuzz contains functions to help fuzz test parquet encodings.
|
Package fuzz contains functions to help fuzz test parquet encodings. |
Package plain implements the PLAIN parquet encoding.
|
Package plain implements the PLAIN parquet encoding. |
Package rle implements the hybrid RLE/Bit-Packed encoding employed in repetition and definition levels, dictionary indexed data pages, and boolean values in the PLAIN encoding.
|
Package rle implements the hybrid RLE/Bit-Packed encoding employed in repetition and definition levels, dictionary indexed data pages, and boolean values in the PLAIN encoding. |