You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
While we can add intervals to timestamp variants (LHS: Timestamp (like TimestampSecond), RHS: Interval (like IntervalYearMonth)), we cannot replace the sides (LHS: Interval, RHS: Timestamp), and get the error Err(Internal("Operator + is not implemented for variants IntervalYearMonth(\"1\") and TimestampSecond(12345678, None)"))
Addition should be commutative for intervals and timestamps, unlike subtraction.
Describe the solution you'd like
In impl_op macro, the match arms can be extended to handle Interval variants for addition, and an adder function can be implemented.
Describe alternatives you've considered
Only the order of the parameters can be changed before calling that impl_op macro since Timestamp + Interval operations are working.
Additional context
This feature can also be extended to cover operations between interval variants (IntervalYearMonth, IntervalDayTime, IntervalMonthDayNano). We can use addition and subtraction operators between them (negatively resulting situations should be under consideration).
The text was updated successfully, but these errors were encountered:
I think this would be a good first issue as datafusion already supports timestamp + interval so this PR is about figuring out enough of binary.rs to support interval + timestamp. Also added to #3148 to track
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
While we can add intervals to timestamp variants (LHS: Timestamp (like
TimestampSecond
), RHS: Interval (likeIntervalYearMonth
)), we cannot replace the sides (LHS: Interval, RHS: Timestamp), and get the errorErr(Internal("Operator + is not implemented for variants IntervalYearMonth(\"1\") and TimestampSecond(12345678, None)"))
Addition should be commutative for intervals and timestamps, unlike subtraction.
Describe the solution you'd like
In
impl_op
macro, the match arms can be extended to handle Interval variants for addition, and an adder function can be implemented.Describe alternatives you've considered
Only the order of the parameters can be changed before calling that
impl_op
macro since Timestamp + Interval operations are working.Additional context
This feature can also be extended to cover operations between interval variants (
IntervalYearMonth
,IntervalDayTime
,IntervalMonthDayNano
). We can use addition and subtraction operators between them (negatively resulting situations should be under consideration).The text was updated successfully, but these errors were encountered: