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 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 NotSupported
- func (NotSupported) DecodeBoolean(dst, src []byte) ([]byte, error)
- func (NotSupported) DecodeByteArray(dst, src []byte) ([]byte, error)
- func (NotSupported) DecodeDouble(dst, src []byte) ([]byte, error)
- func (NotSupported) DecodeFixedLenByteArray(dst, src []byte, size int) ([]byte, error)
- func (NotSupported) DecodeFloat(dst, src []byte) ([]byte, error)
- func (NotSupported) DecodeInt32(dst, src []byte) ([]byte, error)
- func (NotSupported) DecodeInt64(dst, src []byte) ([]byte, error)
- func (NotSupported) DecodeInt96(dst, src []byte) ([]byte, error)
- func (NotSupported) DecodeLevels(dst, src []byte) ([]byte, error)
- func (NotSupported) EncodeBoolean(dst, src []byte) ([]byte, error)
- func (NotSupported) EncodeByteArray(dst, src []byte) ([]byte, error)
- func (NotSupported) EncodeDouble(dst, src []byte) ([]byte, error)
- func (NotSupported) EncodeFixedLenByteArray(dst, src []byte, size int) ([]byte, error)
- func (NotSupported) EncodeFloat(dst, src []byte) ([]byte, error)
- func (NotSupported) EncodeInt32(dst, src []byte) ([]byte, error)
- func (NotSupported) EncodeInt64(dst, src []byte) ([]byte, error)
- func (NotSupported) EncodeInt96(dst, src []byte) ([]byte, error)
- func (NotSupported) EncodeLevels(dst, src []byte) ([]byte, error)
- func (NotSupported) Encoding() format.Encoding
- func (NotSupported) String() string
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 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 source are expected to be encoded using the PLAIN encoding, and // therefore the methods act as conversions into the target encoding. EncodeLevels(dst, src []byte) ([]byte, error) EncodeBoolean(dst, src []byte) ([]byte, error) EncodeInt32(dst, src []byte) ([]byte, error) EncodeInt64(dst, src []byte) ([]byte, error) EncodeInt96(dst, src []byte) ([]byte, error) EncodeFloat(dst, src []byte) ([]byte, error) EncodeDouble(dst, src []byte) ([]byte, error) EncodeByteArray(dst, src []byte) ([]byte, error) EncodeFixedLenByteArray(dst, 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. // // Values are written in the destination buffer in the PLAIN encoding. DecodeLevels(dst, src []byte) ([]byte, error) DecodeBoolean(dst, src []byte) ([]byte, error) DecodeInt32(dst, src []byte) ([]byte, error) DecodeInt64(dst, src []byte) ([]byte, error) DecodeInt96(dst, src []byte) ([]byte, error) DecodeFloat(dst, src []byte) ([]byte, error) DecodeDouble(dst, src []byte) ([]byte, error) DecodeByteArray(dst, src []byte) ([]byte, error) DecodeFixedLenByteArray(dst, src []byte, size int) ([]byte, error) }
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) DecodeBoolean ¶
func (NotSupported) DecodeBoolean(dst, src []byte) ([]byte, error)
func (NotSupported) DecodeByteArray ¶
func (NotSupported) DecodeByteArray(dst, src []byte) ([]byte, error)
func (NotSupported) DecodeDouble ¶
func (NotSupported) DecodeDouble(dst, src []byte) ([]byte, error)
func (NotSupported) DecodeFixedLenByteArray ¶
func (NotSupported) DecodeFixedLenByteArray(dst, src []byte, size int) ([]byte, error)
func (NotSupported) DecodeFloat ¶
func (NotSupported) DecodeFloat(dst, src []byte) ([]byte, error)
func (NotSupported) DecodeInt32 ¶
func (NotSupported) DecodeInt32(dst, src []byte) ([]byte, error)
func (NotSupported) DecodeInt64 ¶
func (NotSupported) DecodeInt64(dst, src []byte) ([]byte, error)
func (NotSupported) DecodeInt96 ¶
func (NotSupported) DecodeInt96(dst, src []byte) ([]byte, error)
func (NotSupported) DecodeLevels ¶
func (NotSupported) DecodeLevels(dst, src []byte) ([]byte, error)
func (NotSupported) EncodeBoolean ¶
func (NotSupported) EncodeBoolean(dst, src []byte) ([]byte, error)
func (NotSupported) EncodeByteArray ¶
func (NotSupported) EncodeByteArray(dst, src []byte) ([]byte, error)
func (NotSupported) EncodeDouble ¶
func (NotSupported) EncodeDouble(dst, src []byte) ([]byte, error)
func (NotSupported) EncodeFixedLenByteArray ¶
func (NotSupported) EncodeFixedLenByteArray(dst, src []byte, size int) ([]byte, error)
func (NotSupported) EncodeFloat ¶
func (NotSupported) EncodeFloat(dst, src []byte) ([]byte, error)
func (NotSupported) EncodeInt32 ¶
func (NotSupported) EncodeInt32(dst, src []byte) ([]byte, error)
func (NotSupported) EncodeInt64 ¶
func (NotSupported) EncodeInt64(dst, src []byte) ([]byte, error)
func (NotSupported) EncodeInt96 ¶
func (NotSupported) EncodeInt96(dst, src []byte) ([]byte, error)
func (NotSupported) EncodeLevels ¶
func (NotSupported) EncodeLevels(dst, src []byte) ([]byte, error)
func (NotSupported) Encoding ¶
func (NotSupported) Encoding() format.Encoding
func (NotSupported) String ¶
func (NotSupported) String() string
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. |