@@ -29,8 +29,8 @@ use tokio_stream::Stream;
2929use crate :: client:: LoadMethod ;
3030use crate :: conn:: { ConnectionInfo , IConnection , Reader } ;
3131use databend_client:: schema:: { Schema , SchemaRef } ;
32- use databend_client:: APIClient ;
3332use databend_client:: Pages ;
33+ use databend_client:: { APIClient , ResultFormatSettings } ;
3434use databend_driver_core:: error:: { Error , Result } ;
3535use databend_driver_core:: raw_rows:: { RawRow , RawRowIterator , RawRowWithStats } ;
3636use databend_driver_core:: rows:: {
@@ -296,7 +296,7 @@ pub struct RestAPIRows<T> {
296296 pages : Pages ,
297297
298298 schema : SchemaRef ,
299- timezone : Tz ,
299+ settings : ResultFormatSettings ,
300300
301301 data : VecDeque < Vec < Option < String > > > ,
302302 rows : VecDeque < Row > ,
@@ -308,11 +308,11 @@ pub struct RestAPIRows<T> {
308308
309309impl < T > RestAPIRows < T > {
310310 async fn from_pages ( pages : Pages ) -> Result < ( Schema , Self ) > {
311- let ( pages, schema, timezone ) = pages. wait_for_schema ( true ) . await ?;
311+ let ( pages, schema, settings ) = pages. wait_for_schema ( true ) . await ?;
312312 let rows = Self {
313313 pages,
314314 schema : Arc :: new ( schema. clone ( ) ) ,
315- timezone ,
315+ settings ,
316316 data : Default :: default ( ) ,
317317 rows : Default :: default ( ) ,
318318 stats : None ,
@@ -333,7 +333,7 @@ impl<T: FromRowStats + std::marker::Unpin> Stream for RestAPIRows<T> {
333333 // Therefore, we could guarantee the `/final` called before the last row.
334334 if self . data . len ( ) > 1 {
335335 if let Some ( row) = self . data . pop_front ( ) {
336- let row = T :: try_from_raw_row ( row, self . schema . clone ( ) , self . timezone ) ?;
336+ let row = T :: try_from_raw_row ( row, self . schema . clone ( ) , self . settings . timezone ) ?;
337337 return Poll :: Ready ( Some ( Ok ( row) ) ) ;
338338 }
339339 } else if self . rows . len ( ) > 1 {
@@ -357,7 +357,7 @@ impl<T: FromRowStats + std::marker::Unpin> Stream for RestAPIRows<T> {
357357 self . data . append ( & mut new_data) ;
358358 } else {
359359 for batch in page. batches . into_iter ( ) {
360- let rows = Rows :: try_from ( ( batch, self . timezone ) ) ?;
360+ let rows = Rows :: try_from ( ( batch, self . settings ) ) ?;
361361 self . rows . extend ( rows) ;
362362 }
363363 }
@@ -369,7 +369,8 @@ impl<T: FromRowStats + std::marker::Unpin> Stream for RestAPIRows<T> {
369369 let row = T :: from_row ( row) ;
370370 Poll :: Ready ( Some ( Ok ( row) ) )
371371 } else if let Some ( row) = self . data . pop_front ( ) {
372- let row = T :: try_from_raw_row ( row, self . schema . clone ( ) , self . timezone ) ?;
372+ let row =
373+ T :: try_from_raw_row ( row, self . schema . clone ( ) , self . settings . timezone ) ?;
373374 Poll :: Ready ( Some ( Ok ( row) ) )
374375 } else {
375376 Poll :: Ready ( None )
0 commit comments