@@ -3,8 +3,8 @@ package querier
33import (
44 "testing"
55
6- "github.com/apache/arrow/ go/v14 /arrow"
7- "github.com/apache/arrow/ go/v14 /arrow/array"
6+ "github.com/apache/arrow- go/v18 /arrow"
7+ "github.com/apache/arrow- go/v18 /arrow/array"
88 "github.com/stretchr/testify/assert"
99)
1010
@@ -26,10 +26,10 @@ func TestConvertResultsToArrow(t *testing.T) {
2626 check : func (t * testing.T , record arrow.Record ) {
2727 assert .Equal (t , int64 (1 ), record .NumRows ())
2828 assert .Equal (t , int64 (1 ), record .NumCols ())
29-
29+
3030 col := record .Column (0 )
3131 assert .IsType (t , & array.Timestamp {}, col )
32-
32+
3333 ts := col .(* array.Timestamp )
3434 assert .False (t , ts .IsNull (0 ))
3535 assert .Equal (t , arrow .Timestamp (1704067200000000000 ), ts .Value (0 ))
@@ -48,29 +48,29 @@ func TestConvertResultsToArrow(t *testing.T) {
4848 check : func (t * testing.T , record arrow.Record ) {
4949 assert .Equal (t , int64 (1 ), record .NumRows ())
5050 assert .Equal (t , int64 (3 ), record .NumCols ())
51-
51+
5252 // Check all fields are timestamp type
5353 for i := 0 ; i < int (record .NumCols ()); i ++ {
5454 field := record .Schema ().Field (i )
5555 assert .IsType (t , & arrow.TimestampType {}, field .Type )
5656 assert .Equal (t , arrow .Nanosecond , field .Type .(* arrow.TimestampType ).Unit )
5757 assert .Equal (t , "UTC" , field .Type .(* arrow.TimestampType ).TimeZone )
5858 }
59-
59+
6060 // Check time column (nanoseconds)
6161 timeCol := record .Column (0 )
6262 assert .IsType (t , & array.Timestamp {}, timeCol )
6363 ts := timeCol .(* array.Timestamp )
6464 assert .False (t , ts .IsNull (0 ))
6565 assert .Equal (t , arrow .Timestamp (1704067200000000000 ), ts .Value (0 ))
66-
66+
6767 // Check time_str column
6868 timeStrCol := record .Column (1 )
6969 assert .IsType (t , & array.Timestamp {}, timeStrCol )
7070 tsStr := timeStrCol .(* array.Timestamp )
7171 assert .False (t , tsStr .IsNull (0 ))
7272 assert .Equal (t , arrow .Timestamp (1704067200000000000 ), tsStr .Value (0 ))
73-
73+
7474 // Check time_int column
7575 timeIntCol := record .Column (2 )
7676 assert .IsType (t , & array.Timestamp {}, timeIntCol )
@@ -90,10 +90,10 @@ func TestConvertResultsToArrow(t *testing.T) {
9090 check : func (t * testing.T , record arrow.Record ) {
9191 assert .Equal (t , int64 (1 ), record .NumRows ())
9292 assert .Equal (t , int64 (1 ), record .NumCols ())
93-
93+
9494 col := record .Column (0 )
9595 assert .IsType (t , & array.Timestamp {}, col )
96-
96+
9797 ts := col .(* array.Timestamp )
9898 assert .True (t , ts .IsNull (0 ))
9999 },
@@ -113,38 +113,38 @@ func TestConvertResultsToArrow(t *testing.T) {
113113 check : func (t * testing.T , record arrow.Record ) {
114114 assert .Equal (t , int64 (1 ), record .NumRows ())
115115 assert .Equal (t , int64 (5 ), record .NumCols ())
116-
116+
117117 // Find columns by name
118118 timeCol := findColumnByName (record , "time" )
119119 countCol := findColumnByName (record , "count" )
120120 valueCol := findColumnByName (record , "value" )
121121 activeCol := findColumnByName (record , "active" )
122122 messageCol := findColumnByName (record , "message" )
123-
123+
124124 // Check time column
125125 assert .IsType (t , & array.Timestamp {}, timeCol )
126126 ts := timeCol .(* array.Timestamp )
127127 assert .False (t , ts .IsNull (0 ))
128128 assert .Equal (t , arrow .Timestamp (1704067200000000000 ), ts .Value (0 ))
129-
129+
130130 // Check count column
131131 assert .IsType (t , & array.Int64 {}, countCol )
132132 count := countCol .(* array.Int64 )
133133 assert .False (t , count .IsNull (0 ))
134134 assert .Equal (t , int64 (42 ), count .Value (0 ))
135-
135+
136136 // Check value column
137137 assert .IsType (t , & array.Float64 {}, valueCol )
138138 value := valueCol .(* array.Float64 )
139139 assert .False (t , value .IsNull (0 ))
140140 assert .Equal (t , float64 (3.14 ), value .Value (0 ))
141-
141+
142142 // Check active column
143143 assert .IsType (t , & array.Boolean {}, activeCol )
144144 active := activeCol .(* array.Boolean )
145145 assert .False (t , active .IsNull (0 ))
146146 assert .Equal (t , true , active .Value (0 ))
147-
147+
148148 // Check message column
149149 assert .IsType (t , & array.String {}, messageCol )
150150 message := messageCol .(* array.String )
@@ -163,10 +163,10 @@ func TestConvertResultsToArrow(t *testing.T) {
163163 check : func (t * testing.T , record arrow.Record ) {
164164 assert .Equal (t , int64 (1 ), record .NumRows ())
165165 assert .Equal (t , int64 (1 ), record .NumCols ())
166-
166+
167167 col := record .Column (0 )
168168 assert .IsType (t , & array.Timestamp {}, col )
169-
169+
170170 ts := col .(* array.Timestamp )
171171 assert .True (t , ts .IsNull (0 ))
172172 },
@@ -179,12 +179,12 @@ func TestConvertResultsToArrow(t *testing.T) {
179179 assert .NoError (t , err )
180180 assert .NotNil (t , schema )
181181 assert .NotNil (t , record )
182-
182+
183183 // Check schema of time column
184184 timeField := schema .Field (0 )
185185 assert .Equal (t , "time" , timeField .Name )
186186 assert .Equal (t , tt .wantType , timeField .Type )
187-
187+
188188 // Run custom checks
189189 tt .check (t , record )
190190 })
@@ -285,4 +285,4 @@ func findFieldByName(schema *arrow.Schema, name string) arrow.Field {
285285 }
286286 }
287287 return arrow.Field {}
288- }
288+ }
0 commit comments