@@ -19,13 +19,14 @@ use std::sync::Arc;
1919
2020use arrow:: array:: { ArrayRef , RecordBatch } ;
2121use arrow:: datatypes:: {
22- BooleanType , DataType , Date32Type , Date64Type , Decimal128Type , Decimal256Type , Field ,
23- Float32Type , Float64Type , Int16Type , Int32Type , Int64Type , Int8Type ,
24- IntervalDayTimeType , IntervalMonthDayNanoType , IntervalUnit , IntervalYearMonthType ,
25- Schema , Time32MillisecondType , Time32SecondType , Time64MicrosecondType ,
26- Time64NanosecondType , TimeUnit , TimestampMicrosecondType , TimestampMillisecondType ,
27- TimestampNanosecondType , TimestampSecondType , UInt16Type , UInt32Type , UInt64Type ,
28- UInt8Type ,
22+ BooleanType , DataType , Date32Type , Date64Type , Decimal128Type , Decimal256Type ,
23+ DurationMicrosecondType , DurationMillisecondType , DurationNanosecondType ,
24+ DurationSecondType , Field , Float32Type , Float64Type , Int16Type , Int32Type , Int64Type ,
25+ Int8Type , IntervalDayTimeType , IntervalMonthDayNanoType , IntervalUnit ,
26+ IntervalYearMonthType , Schema , Time32MillisecondType , Time32SecondType ,
27+ Time64MicrosecondType , Time64NanosecondType , TimeUnit , TimestampMicrosecondType ,
28+ TimestampMillisecondType , TimestampNanosecondType , TimestampSecondType , UInt16Type ,
29+ UInt32Type , UInt64Type , UInt8Type ,
2930} ;
3031use arrow_schema:: {
3132 DECIMAL128_MAX_PRECISION , DECIMAL128_MAX_SCALE , DECIMAL256_MAX_PRECISION ,
@@ -85,6 +86,23 @@ pub fn get_supported_types_columns(rng_seed: u64) -> Vec<ColumnDescr> {
8586 "interval_month_day_nano" ,
8687 DataType :: Interval ( IntervalUnit :: MonthDayNano ) ,
8788 ) ,
89+ // Internal error: AggregationFuzzer task error: JoinError::Panic(Id(29108), "called `Option::unwrap()` on a `None` value", ...).
90+ // ColumnDescr::new(
91+ // "duration_seconds",
92+ // DataType::Duration(TimeUnit::Second),
93+ // ),
94+ ColumnDescr :: new(
95+ "duration_milliseconds" ,
96+ DataType :: Duration ( TimeUnit :: Millisecond ) ,
97+ ) ,
98+ ColumnDescr :: new(
99+ "duration_microsecond" ,
100+ DataType :: Duration ( TimeUnit :: Microsecond ) ,
101+ ) ,
102+ ColumnDescr :: new(
103+ "duration_nanosecond" ,
104+ DataType :: Duration ( TimeUnit :: Nanosecond ) ,
105+ ) ,
88106 ColumnDescr :: new( "decimal128" , {
89107 let precision: u8 = rng. gen_range( 1 ..=DECIMAL128_MAX_PRECISION ) ;
90108 let scale: i8 = rng. gen_range(
@@ -484,6 +502,46 @@ impl RecordBatchGenerator {
484502 IntervalMonthDayNanoType
485503 )
486504 }
505+ DataType :: Duration ( TimeUnit :: Second ) => {
506+ generate_primitive_array ! (
507+ self ,
508+ num_rows,
509+ max_num_distinct,
510+ batch_gen_rng,
511+ array_gen_rng,
512+ DurationSecondType
513+ )
514+ }
515+ DataType :: Duration ( TimeUnit :: Millisecond ) => {
516+ generate_primitive_array ! (
517+ self ,
518+ num_rows,
519+ max_num_distinct,
520+ batch_gen_rng,
521+ array_gen_rng,
522+ DurationMillisecondType
523+ )
524+ }
525+ DataType :: Duration ( TimeUnit :: Microsecond ) => {
526+ generate_primitive_array ! (
527+ self ,
528+ num_rows,
529+ max_num_distinct,
530+ batch_gen_rng,
531+ array_gen_rng,
532+ DurationMicrosecondType
533+ )
534+ }
535+ DataType :: Duration ( TimeUnit :: Nanosecond ) => {
536+ generate_primitive_array ! (
537+ self ,
538+ num_rows,
539+ max_num_distinct,
540+ batch_gen_rng,
541+ array_gen_rng,
542+ DurationNanosecondType
543+ )
544+ }
487545 DataType :: Timestamp ( TimeUnit :: Second , None ) => {
488546 generate_primitive_array ! (
489547 self ,
0 commit comments