File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -398,11 +398,6 @@ impl AggregateUDFImpl for Sum {
398398 if lit_type == DataType :: Null {
399399 return Ok ( None ) ;
400400 }
401- // Skip the rewrite for interval: it requires `lit * COUNT(arg)`, but
402- // there is no generic Interval×Int64 multiplication kernel.
403- if matches ! ( lit_type, DataType :: Interval ( _) ) {
404- return Ok ( None ) ;
405- }
406401
407402 // Build up SUM(arg)
408403 let mut sum_agg = agg_function. clone ( ) ;
Original file line number Diff line number Diff line change @@ -6627,9 +6627,7 @@ SELECT sum(DISTINCT v) FROM (VALUES
66276627----
662866283 days
66296629
6630- # Regression: SUM(col + interval_lit) must NOT be rewritten to
6631- # SUM(col) + lit * COUNT(col) by simplify_expr_op_literal — there is no
6632- # Interval×Int64 multiplication kernel. Without the guard, this query fails.
6630+ # SUM(col + interval_lit) — exercises the simplify_expr_op_literal path.
66336631query ?
66346632SELECT sum(v + interval '1 day') FROM (VALUES
66356633 (interval '1 day'),
You can’t perform that action at this time.
0 commit comments