88 "os"
99 "testing"
1010
11+ "github.com/databricks/databricks-sql-go/driverctx"
1112 "github.com/databricks/databricks-sql-go/internal/cli_service"
1213 "github.com/databricks/databricks-sql-go/internal/client"
1314 "github.com/databricks/databricks-sql-go/internal/config"
@@ -32,15 +33,17 @@ func TestArrowRecordIterator(t *testing.T) {
3233
3334 var fetchesInfo []fetchResultsInfo
3435
36+ ctx := driverctx .NewContextWithConnId (context .Background (), "connectionId" )
37+ ctx = driverctx .NewContextWithCorrelationId (ctx , "correlationId" )
38+
3539 simpleClient := getSimpleClient (& fetchesInfo , []cli_service.TFetchResultsResp {fetchResp1 , fetchResp2 })
3640 rpi := rowscanner .NewResultPageIterator (
41+ ctx ,
3742 rowscanner .NewDelimiter (0 , 7311 ),
3843 5000 ,
3944 nil ,
4045 false ,
4146 simpleClient ,
42- "connectionId" ,
43- "correlationId" ,
4447 logger ,
4548 )
4649
@@ -126,17 +129,19 @@ func TestArrowRecordIterator(t *testing.T) {
126129 fetchResp3 := cli_service.TFetchResultsResp {}
127130 loadTestData2 (t , "multipleFetch/FetchResults3.json" , & fetchResp3 )
128131
132+ ctx := driverctx .NewContextWithConnId (context .Background (), "connectionId" )
133+ ctx = driverctx .NewContextWithCorrelationId (ctx , "correlationId" )
134+
129135 var fetchesInfo []fetchResultsInfo
130136
131137 simpleClient := getSimpleClient (& fetchesInfo , []cli_service.TFetchResultsResp {fetchResp1 , fetchResp2 , fetchResp3 })
132138 rpi := rowscanner .NewResultPageIterator (
139+ ctx ,
133140 rowscanner .NewDelimiter (0 , 0 ),
134141 5000 ,
135142 nil ,
136143 false ,
137144 simpleClient ,
138- "connectionId" ,
139- "correlationId" ,
140145 logger ,
141146 )
142147
@@ -199,16 +204,18 @@ func TestArrowRecordIteratorSchema(t *testing.T) {
199204 fetchResp1 := cli_service.TFetchResultsResp {}
200205 loadTestData2 (t , "directResultsMultipleFetch/FetchResults1.json" , & fetchResp1 )
201206
207+ ctx := driverctx .NewContextWithConnId (context .Background (), "connectionId" )
208+ ctx = driverctx .NewContextWithCorrelationId (ctx , "correlationId" )
209+
202210 var fetchesInfo []fetchResultsInfo
203211 simpleClient := getSimpleClient (& fetchesInfo , []cli_service.TFetchResultsResp {fetchResp1 })
204212 rpi := rowscanner .NewResultPageIterator (
213+ ctx ,
205214 rowscanner .NewDelimiter (0 , 0 ),
206215 5000 ,
207216 nil ,
208217 false ,
209218 simpleClient ,
210- "connectionId" ,
211- "correlationId" ,
212219 logger ,
213220 )
214221
@@ -251,16 +258,18 @@ func TestArrowRecordIteratorSchema(t *testing.T) {
251258 fetchResp1 := cli_service.TFetchResultsResp {}
252259 loadTestData2 (t , "multipleFetch/FetchResults1.json" , & fetchResp1 )
253260
261+ ctx := driverctx .NewContextWithConnId (context .Background (), "connectionId" )
262+ ctx = driverctx .NewContextWithCorrelationId (ctx , "correlationId" )
263+
254264 var fetchesInfo []fetchResultsInfo
255265 simpleClient := getSimpleClient (& fetchesInfo , []cli_service.TFetchResultsResp {fetchResp1 })
256266 rpi := rowscanner .NewResultPageIterator (
267+ ctx ,
257268 rowscanner .NewDelimiter (0 , 0 ),
258269 5000 ,
259270 nil ,
260271 false ,
261272 simpleClient ,
262- "connectionId" ,
263- "correlationId" ,
264273 logger ,
265274 )
266275
@@ -293,14 +302,16 @@ func TestArrowRecordIteratorSchema(t *testing.T) {
293302 },
294303 }
295304
305+ ctx := driverctx .NewContextWithConnId (context .Background (), "connectionId" )
306+ ctx = driverctx .NewContextWithCorrelationId (ctx , "correlationId" )
307+
296308 rpi := rowscanner .NewResultPageIterator (
309+ ctx ,
297310 rowscanner .NewDelimiter (0 , 0 ),
298311 5000 ,
299312 nil ,
300313 false ,
301314 failingClient ,
302- "connectionId" ,
303- "correlationId" ,
304315 logger ,
305316 )
306317
0 commit comments