package arrow
type OffsetTraits interface {
BytesRequired (int ) int
}
type BinaryType struct {}
func (t *BinaryType ) ID () Type { return BINARY }
func (t *BinaryType ) Name () string { return "binary" }
func (t *BinaryType ) String () string { return "binary" }
func (t *BinaryType ) binary () {}
func (t *BinaryType ) Fingerprint () string { return typeFingerprint (t ) }
func (t *BinaryType ) Layout () DataTypeLayout {
return DataTypeLayout {Buffers : []BufferSpec {SpecBitmap (),
SpecFixedWidth (Int32SizeBytes ), SpecVariableWidth ()}}
}
func (t *BinaryType ) OffsetTypeTraits () OffsetTraits { return Int32Traits }
func (BinaryType ) IsUtf8 () bool { return false }
type StringType struct {}
func (t *StringType ) ID () Type { return STRING }
func (t *StringType ) Name () string { return "utf8" }
func (t *StringType ) String () string { return "utf8" }
func (t *StringType ) binary () {}
func (t *StringType ) Fingerprint () string { return typeFingerprint (t ) }
func (t *StringType ) Layout () DataTypeLayout {
return DataTypeLayout {Buffers : []BufferSpec {SpecBitmap (),
SpecFixedWidth (Int32SizeBytes ), SpecVariableWidth ()}}
}
func (t *StringType ) OffsetTypeTraits () OffsetTraits { return Int32Traits }
func (StringType ) IsUtf8 () bool { return true }
type LargeBinaryType struct {}
func (t *LargeBinaryType ) ID () Type { return LARGE_BINARY }
func (t *LargeBinaryType ) Name () string { return "large_binary" }
func (t *LargeBinaryType ) String () string { return "large_binary" }
func (t *LargeBinaryType ) binary () {}
func (t *LargeBinaryType ) Fingerprint () string { return typeFingerprint (t ) }
func (t *LargeBinaryType ) Layout () DataTypeLayout {
return DataTypeLayout {Buffers : []BufferSpec {SpecBitmap (),
SpecFixedWidth (Int64SizeBytes ), SpecVariableWidth ()}}
}
func (t *LargeBinaryType ) OffsetTypeTraits () OffsetTraits { return Int64Traits }
func (LargeBinaryType ) IsUtf8 () bool { return false }
type LargeStringType struct {}
func (t *LargeStringType ) ID () Type { return LARGE_STRING }
func (t *LargeStringType ) Name () string { return "large_utf8" }
func (t *LargeStringType ) String () string { return "large_utf8" }
func (t *LargeStringType ) binary () {}
func (t *LargeStringType ) Fingerprint () string { return typeFingerprint (t ) }
func (t *LargeStringType ) Layout () DataTypeLayout {
return DataTypeLayout {Buffers : []BufferSpec {SpecBitmap (),
SpecFixedWidth (Int64SizeBytes ), SpecVariableWidth ()}}
}
func (t *LargeStringType ) OffsetTypeTraits () OffsetTraits { return Int64Traits }
func (LargeStringType ) IsUtf8 () bool { return true }
type BinaryViewType struct {}
func (*BinaryViewType ) ID () Type { return BINARY_VIEW }
func (*BinaryViewType ) Name () string { return "binary_view" }
func (*BinaryViewType ) String () string { return "binary_view" }
func (*BinaryViewType ) IsUtf8 () bool { return false }
func (*BinaryViewType ) binary () {}
func (*BinaryViewType ) view () {}
func (t *BinaryViewType ) Fingerprint () string { return typeFingerprint (t ) }
func (*BinaryViewType ) Layout () DataTypeLayout {
variadic := SpecVariableWidth ()
return DataTypeLayout {
Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (ViewHeaderSizeBytes )},
VariadicSpec : &variadic ,
}
}
type StringViewType struct {}
func (*StringViewType ) ID () Type { return STRING_VIEW }
func (*StringViewType ) Name () string { return "string_view" }
func (*StringViewType ) String () string { return "string_view" }
func (*StringViewType ) IsUtf8 () bool { return true }
func (*StringViewType ) binary () {}
func (*StringViewType ) view () {}
func (t *StringViewType ) Fingerprint () string { return typeFingerprint (t ) }
func (*StringViewType ) Layout () DataTypeLayout {
variadic := SpecVariableWidth ()
return DataTypeLayout {
Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (ViewHeaderSizeBytes )},
VariadicSpec : &variadic ,
}
}
var (
BinaryTypes = struct {
Binary BinaryDataType
String BinaryDataType
LargeBinary BinaryDataType
LargeString BinaryDataType
BinaryView BinaryDataType
StringView BinaryDataType
}{
Binary : &BinaryType {},
String : &StringType {},
LargeBinary : &LargeBinaryType {},
LargeString : &LargeStringType {},
BinaryView : &BinaryViewType {},
StringView : &StringViewType {},
}
_ BinaryViewDataType = (*StringViewType )(nil )
_ BinaryViewDataType = (*BinaryViewType )(nil )
)
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 .