Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 3b27876

Browse files
author
Chao Wang
committed
Update test
1 parent a8d640b commit 3b27876

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

clickhouse_columnar_test.go

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func Test_ColumnarInsert(t *testing.T) {
2828
enum8 Enum8 ('a' = 1, 'b' = 2),
2929
enum16 Enum16('c' = 1, 'd' = 2),
3030
array Array(String),
31-
array2 Array(String),
31+
array2 Array(UInt64),
3232
arrayArray Array(Array(String))
3333
) Engine=Memory
3434
`
@@ -108,7 +108,7 @@ func Test_ColumnarInsert(t *testing.T) {
108108
block.WriteUInt8(10, 1)
109109
block.WriteUInt16(11, 2)
110110
block.WriteArray(12, []string{"A", "B", "C"})
111-
block.WriteArrayWithValue(13, stringSliceValue{value: []string{"A", "B", "C"}})
111+
block.WriteArrayWithValue(13, uint64SliceValue{value: []uint64{1, 2, 3}})
112112
block.WriteArray(14, [][]string{[]string{"A", "B"}, []string{"CC", "DD", "EE"}})
113113
if !assert.NoError(t, err) {
114114
return
@@ -122,41 +122,42 @@ func Test_ColumnarInsert(t *testing.T) {
122122
}
123123
}
124124

125-
type stringValue struct {
126-
value string
125+
type uint64Value struct {
126+
value uint64
127127
}
128128

129-
func (v stringValue) Kind() reflect.Kind {
129+
func (v uint64Value) Kind() reflect.Kind {
130130
return reflect.String
131131
}
132132

133-
func (v stringValue) Len() int {
134-
panic("string has no length")
133+
func (v uint64Value) Len() int {
134+
panic("uint64 has no length")
135135
}
136-
func (v stringValue) Index(i int) data.Value {
137-
panic("string has no index")
136+
137+
func (v uint64Value) Index(i int) data.Value {
138+
panic("uint64 has no index")
138139
}
139140

140-
func (v stringValue) Interface() interface{} {
141+
func (v uint64Value) Interface() interface{} {
141142
return v.value
142143
}
143144

144-
type stringSliceValue struct {
145-
value []string
145+
type uint64SliceValue struct {
146+
value []uint64
146147
}
147148

148-
func (v stringSliceValue) Kind() reflect.Kind {
149+
func (v uint64SliceValue) Kind() reflect.Kind {
149150
return reflect.Slice
150151
}
151152

152-
func (v stringSliceValue) Len() int {
153+
func (v uint64SliceValue) Len() int {
153154
return len(v.value)
154155
}
155156

156-
func (v stringSliceValue) Index(i int) data.Value {
157-
return stringValue{value: v.value[i]}
157+
func (v uint64SliceValue) Index(i int) data.Value {
158+
return uint64Value{value: v.value[i]}
158159
}
159160

160-
func (v stringSliceValue) Interface() interface{} {
161+
func (v uint64SliceValue) Interface() interface{} {
161162
return v.value
162163
}

0 commit comments

Comments
 (0)