package arrow
type EncodedType interface {
DataType
Encoded () DataType
}
type RunEndEncodedType struct {
runEnds DataType
values DataType
ValueNullable bool
}
func RunEndEncodedOf (runEnds , values DataType ) *RunEndEncodedType {
return &RunEndEncodedType {runEnds : runEnds , values : values , ValueNullable : true }
}
func (*RunEndEncodedType ) ID () Type { return RUN_END_ENCODED }
func (*RunEndEncodedType ) Name () string { return "run_end_encoded" }
func (*RunEndEncodedType ) Layout () DataTypeLayout {
return DataTypeLayout {Buffers : []BufferSpec {SpecAlwaysNull ()}}
}
func (t *RunEndEncodedType ) String () string {
return t .Name () + "<run_ends: " + t .runEnds .String () + ", values: " + t .values .String () + ">"
}
func (t *RunEndEncodedType ) Fingerprint () string {
return typeFingerprint (t ) + "{" + t .runEnds .Fingerprint () + ";" + t .values .Fingerprint () + ";}"
}
func (t *RunEndEncodedType ) RunEnds () DataType { return t .runEnds }
func (t *RunEndEncodedType ) Encoded () DataType { return t .values }
func (t *RunEndEncodedType ) Fields () []Field {
return []Field {
{Name : "run_ends" , Type : t .runEnds },
{Name : "values" , Type : t .values , Nullable : t .ValueNullable },
}
}
func (t *RunEndEncodedType ) NumFields () int { return 2 }
func (*RunEndEncodedType ) ValidRunEndsType (dt DataType ) bool {
switch dt .ID () {
case INT16 , INT32 , INT64 :
return true
}
return false
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .