samuelcolvin opened a new pull request, #11876:
URL: https://github.com/apache/datafusion/pull/11876

   ## Which issue does this PR close?
   
   None AFAIK.
   
   ## Rationale for this change
   
   We regularly want to allow queries of the form
   
   ```sql
   SELECT * FROM records WHERE end_timestamp - start_timestamp > interval '2 
seconds'
   ```
   
   Until now that failed with
   
   ```
   type_coercion: Cannot infer common argument type for comparison operation 
Duration(Microsecond) > Interval(MonthDayNano)
   ```
   
   While working on that, I discovered you couldn't compare to an interval with 
the interval as the left hand side of the operation, so I fixed that too.
   
   ## What changes are included in this PR?
   
   * fix `Duration` vs. `Interval` comparison - sense check - is it really as 
simple as it looks?
   * support more operators in machinery to support intervals as the LHF of 
binary operations
   * add tests for both
   
   ## Are these changes tested?
   
   Yes
   
   ## Are there any user-facing changes?
   
   Should be only the above changes to support SQL.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to