@@ -14,8 +14,9 @@ use arrow::{
1414 } ,
1515 datatypes:: {
1616 DataType , Date32Type , Date64Type , Float32Type , Float64Type , Int16Type , Int32Type ,
17- Int64Type , Int8Type , Time32MillisecondType , Time32SecondType , Time64MicrosecondType ,
18- Time64NanosecondType , TimeUnit , UInt16Type , UInt32Type , UInt64Type , UInt8Type ,
17+ Int64Type , Int8Type , IntervalDayTimeType , IntervalMonthDayNanoType , IntervalUnit ,
18+ Time32MillisecondType , Time32SecondType , Time64MicrosecondType , Time64NanosecondType ,
19+ TimeUnit , UInt16Type , UInt32Type , UInt64Type , UInt8Type ,
1920 } ,
2021 temporal_conversions:: { as_date, as_time} ,
2122} ;
@@ -33,8 +34,9 @@ use datafusion::arrow::{
3334 } ,
3435 datatypes:: {
3536 DataType , Date32Type , Date64Type , Float32Type , Float64Type , Int16Type , Int32Type ,
36- Int64Type , Int8Type , Time32MillisecondType , Time32SecondType , Time64MicrosecondType ,
37- Time64NanosecondType , TimeUnit , UInt16Type , UInt32Type , UInt64Type , UInt8Type ,
37+ Int64Type , Int8Type , IntervalDayTimeType , IntervalMonthDayNanoType , IntervalUnit ,
38+ Time32MillisecondType , Time32SecondType , Time64MicrosecondType , Time64NanosecondType ,
39+ TimeUnit , UInt16Type , UInt32Type , UInt64Type , UInt8Type ,
3840 } ,
3941 temporal_conversions:: { as_date, as_time} ,
4042} ;
@@ -500,7 +502,7 @@ pub fn encode_list<T: Encoder>(
500502 }
501503 } ,
502504 DataType :: Interval ( interval_unit) => match interval_unit {
503- arrow :: datatypes :: IntervalUnit :: YearMonth => {
505+ IntervalUnit :: YearMonth => {
504506 let value: Vec < Option < PgInterval > > = arr
505507 . as_any ( )
506508 . downcast_ref :: < IntervalYearMonthArray > ( )
@@ -511,32 +513,31 @@ pub fn encode_list<T: Encoder>(
511513 encoder. encode_field ( & value, pg_field) ?;
512514 Ok ( ( ) )
513515 }
514- arrow :: datatypes :: IntervalUnit :: DayTime => {
516+ IntervalUnit :: DayTime => {
515517 let value: Vec < Option < PgInterval > > = arr
516518 . as_any ( )
517519 . downcast_ref :: < IntervalDayTimeArray > ( )
518520 . unwrap ( )
519521 . iter ( )
520522 . map ( |val| {
521523 val. map ( |v| {
522- let ( days, millis) = arrow :: datatypes :: IntervalDayTimeType :: to_parts ( v) ;
524+ let ( days, millis) = IntervalDayTimeType :: to_parts ( v) ;
523525 PgInterval :: new ( 0 , days, millis as i64 * 1000i64 )
524526 } )
525527 } )
526528 . collect ( ) ;
527529 encoder. encode_field ( & value, pg_field) ?;
528530 Ok ( ( ) )
529531 }
530- arrow :: datatypes :: IntervalUnit :: MonthDayNano => {
532+ IntervalUnit :: MonthDayNano => {
531533 let value: Vec < Option < PgInterval > > = arr
532534 . as_any ( )
533535 . downcast_ref :: < IntervalMonthDayNanoArray > ( )
534536 . unwrap ( )
535537 . iter ( )
536538 . map ( |val| {
537539 val. map ( |v| {
538- let ( months, days, nanos) =
539- arrow:: datatypes:: IntervalMonthDayNanoType :: to_parts ( v) ;
540+ let ( months, days, nanos) = IntervalMonthDayNanoType :: to_parts ( v) ;
540541 PgInterval :: new ( months, days, nanos / 1000i64 )
541542 } )
542543 } )
0 commit comments