@@ -27,95 +27,97 @@ type OffsetTraits interface {
2727 BytesRequired (int ) int
2828}
2929
30+ var (
31+ binaryTypeLayout = DataTypeLayout {
32+ Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (Int32SizeBytes ), SpecVariableWidth ()},
33+ }
34+ stringTypeLayout = DataTypeLayout {
35+ Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (Int32SizeBytes ), SpecVariableWidth ()},
36+ }
37+ largeBinaryTypeLayout = DataTypeLayout {
38+ Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (Int64SizeBytes ), SpecVariableWidth ()},
39+ }
40+ largeStringTypeLayout = DataTypeLayout {
41+ Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (Int64SizeBytes ), SpecVariableWidth ()},
42+ }
43+
44+ variadic = SpecVariableWidth ()
45+
46+ binaryViewTypeLayout = DataTypeLayout {
47+ Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (ViewHeaderSizeBytes )},
48+ VariadicSpec : & variadic ,
49+ }
50+ stringViewTypeLayout = DataTypeLayout {
51+ Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (ViewHeaderSizeBytes )},
52+ VariadicSpec : & variadic ,
53+ }
54+ )
55+
3056type BinaryType struct {}
3157
32- func (t * BinaryType ) ID () Type { return BINARY }
33- func (t * BinaryType ) Name () string { return "binary" }
34- func (t * BinaryType ) String () string { return "binary" }
35- func (t * BinaryType ) binary () {}
36- func (t * BinaryType ) Fingerprint () string { return typeFingerprint (t ) }
37- func (t * BinaryType ) Layout () DataTypeLayout {
38- return DataTypeLayout {Buffers : []BufferSpec {SpecBitmap (),
39- SpecFixedWidth (Int32SizeBytes ), SpecVariableWidth ()}}
40- }
58+ func (t * BinaryType ) ID () Type { return BINARY }
59+ func (t * BinaryType ) Name () string { return "binary" }
60+ func (t * BinaryType ) String () string { return "binary" }
61+ func (t * BinaryType ) binary () {}
62+ func (t * BinaryType ) Fingerprint () string { return typeFingerprint (t ) }
63+ func (t * BinaryType ) Layout () DataTypeLayout { return binaryTypeLayout }
4164func (t * BinaryType ) OffsetTypeTraits () OffsetTraits { return Int32Traits }
4265func (BinaryType ) IsUtf8 () bool { return false }
4366
4467type StringType struct {}
4568
46- func (t * StringType ) ID () Type { return STRING }
47- func (t * StringType ) Name () string { return "utf8" }
48- func (t * StringType ) String () string { return "utf8" }
49- func (t * StringType ) binary () {}
50- func (t * StringType ) Fingerprint () string { return typeFingerprint (t ) }
51- func (t * StringType ) Layout () DataTypeLayout {
52- return DataTypeLayout {Buffers : []BufferSpec {SpecBitmap (),
53- SpecFixedWidth (Int32SizeBytes ), SpecVariableWidth ()}}
54- }
69+ func (t * StringType ) ID () Type { return STRING }
70+ func (t * StringType ) Name () string { return "utf8" }
71+ func (t * StringType ) String () string { return "utf8" }
72+ func (t * StringType ) binary () {}
73+ func (t * StringType ) Fingerprint () string { return typeFingerprint (t ) }
74+ func (t * StringType ) Layout () DataTypeLayout { return stringTypeLayout }
5575func (t * StringType ) OffsetTypeTraits () OffsetTraits { return Int32Traits }
5676func (StringType ) IsUtf8 () bool { return true }
5777
5878type LargeBinaryType struct {}
5979
60- func (t * LargeBinaryType ) ID () Type { return LARGE_BINARY }
61- func (t * LargeBinaryType ) Name () string { return "large_binary" }
62- func (t * LargeBinaryType ) String () string { return "large_binary" }
63- func (t * LargeBinaryType ) binary () {}
64- func (t * LargeBinaryType ) Fingerprint () string { return typeFingerprint (t ) }
65- func (t * LargeBinaryType ) Layout () DataTypeLayout {
66- return DataTypeLayout {Buffers : []BufferSpec {SpecBitmap (),
67- SpecFixedWidth (Int64SizeBytes ), SpecVariableWidth ()}}
68- }
80+ func (t * LargeBinaryType ) ID () Type { return LARGE_BINARY }
81+ func (t * LargeBinaryType ) Name () string { return "large_binary" }
82+ func (t * LargeBinaryType ) String () string { return "large_binary" }
83+ func (t * LargeBinaryType ) binary () {}
84+ func (t * LargeBinaryType ) Fingerprint () string { return typeFingerprint (t ) }
85+ func (t * LargeBinaryType ) Layout () DataTypeLayout { return largeBinaryTypeLayout }
6986func (t * LargeBinaryType ) OffsetTypeTraits () OffsetTraits { return Int64Traits }
7087func (LargeBinaryType ) IsUtf8 () bool { return false }
7188
7289type LargeStringType struct {}
7390
74- func (t * LargeStringType ) ID () Type { return LARGE_STRING }
75- func (t * LargeStringType ) Name () string { return "large_utf8" }
76- func (t * LargeStringType ) String () string { return "large_utf8" }
77- func (t * LargeStringType ) binary () {}
78- func (t * LargeStringType ) Fingerprint () string { return typeFingerprint (t ) }
79- func (t * LargeStringType ) Layout () DataTypeLayout {
80- return DataTypeLayout {Buffers : []BufferSpec {SpecBitmap (),
81- SpecFixedWidth (Int64SizeBytes ), SpecVariableWidth ()}}
82- }
91+ func (t * LargeStringType ) ID () Type { return LARGE_STRING }
92+ func (t * LargeStringType ) Name () string { return "large_utf8" }
93+ func (t * LargeStringType ) String () string { return "large_utf8" }
94+ func (t * LargeStringType ) binary () {}
95+ func (t * LargeStringType ) Fingerprint () string { return typeFingerprint (t ) }
96+ func (t * LargeStringType ) Layout () DataTypeLayout { return largeStringTypeLayout }
8397func (t * LargeStringType ) OffsetTypeTraits () OffsetTraits { return Int64Traits }
8498func (LargeStringType ) IsUtf8 () bool { return true }
8599
86100type BinaryViewType struct {}
87101
88- func (* BinaryViewType ) ID () Type { return BINARY_VIEW }
89- func (* BinaryViewType ) Name () string { return "binary_view" }
90- func (* BinaryViewType ) String () string { return "binary_view" }
91- func (* BinaryViewType ) IsUtf8 () bool { return false }
92- func (* BinaryViewType ) binary () {}
93- func (* BinaryViewType ) view () {}
94- func (t * BinaryViewType ) Fingerprint () string { return typeFingerprint (t ) }
95- func (* BinaryViewType ) Layout () DataTypeLayout {
96- variadic := SpecVariableWidth ()
97- return DataTypeLayout {
98- Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (ViewHeaderSizeBytes )},
99- VariadicSpec : & variadic ,
100- }
101- }
102+ func (* BinaryViewType ) ID () Type { return BINARY_VIEW }
103+ func (* BinaryViewType ) Name () string { return "binary_view" }
104+ func (* BinaryViewType ) String () string { return "binary_view" }
105+ func (* BinaryViewType ) IsUtf8 () bool { return false }
106+ func (* BinaryViewType ) binary () {}
107+ func (* BinaryViewType ) view () {}
108+ func (t * BinaryViewType ) Fingerprint () string { return typeFingerprint (t ) }
109+ func (* BinaryViewType ) Layout () DataTypeLayout { return binaryViewTypeLayout }
102110
103111type StringViewType struct {}
104112
105- func (* StringViewType ) ID () Type { return STRING_VIEW }
106- func (* StringViewType ) Name () string { return "string_view" }
107- func (* StringViewType ) String () string { return "string_view" }
108- func (* StringViewType ) IsUtf8 () bool { return true }
109- func (* StringViewType ) binary () {}
110- func (* StringViewType ) view () {}
111- func (t * StringViewType ) Fingerprint () string { return typeFingerprint (t ) }
112- func (* StringViewType ) Layout () DataTypeLayout {
113- variadic := SpecVariableWidth ()
114- return DataTypeLayout {
115- Buffers : []BufferSpec {SpecBitmap (), SpecFixedWidth (ViewHeaderSizeBytes )},
116- VariadicSpec : & variadic ,
117- }
118- }
113+ func (* StringViewType ) ID () Type { return STRING_VIEW }
114+ func (* StringViewType ) Name () string { return "string_view" }
115+ func (* StringViewType ) String () string { return "string_view" }
116+ func (* StringViewType ) IsUtf8 () bool { return true }
117+ func (* StringViewType ) binary () {}
118+ func (* StringViewType ) view () {}
119+ func (t * StringViewType ) Fingerprint () string { return typeFingerprint (t ) }
120+ func (* StringViewType ) Layout () DataTypeLayout { return stringViewTypeLayout }
119121
120122var (
121123 BinaryTypes = struct {
0 commit comments