Skip to content

Commit d853365

Browse files
committed
add GroupAccumulator for max duration
1 parent ec1293c commit d853365

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

datafusion/functions-aggregate/src/min_max.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ impl AggregateUDFImpl for Max {
265265
| Binary
266266
| LargeBinary
267267
| BinaryView
268+
| Duration(_)
268269
)
269270
}
270271

@@ -319,6 +320,18 @@ impl AggregateUDFImpl for Max {
319320
Timestamp(Nanosecond, _) => {
320321
primitive_max_accumulator!(data_type, i64, TimestampNanosecondType)
321322
}
323+
Duration(Second) => {
324+
primitive_max_accumulator!(data_type, i64, DurationSecondType)
325+
}
326+
Duration(Millisecond) => {
327+
primitive_max_accumulator!(data_type, i64, DurationMillisecondType)
328+
}
329+
Duration(Microsecond) => {
330+
primitive_max_accumulator!(data_type, i64, DurationMicrosecondType)
331+
}
332+
Duration(Nanosecond) => {
333+
primitive_max_accumulator!(data_type, i64, DurationNanosecondType)
334+
}
322335
Decimal128(_, _) => {
323336
primitive_max_accumulator!(data_type, i128, Decimal128Type)
324337
}

0 commit comments

Comments
 (0)