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

   ## Which issue does this PR close?
   
   - Closes #19038
   
   ## Rationale for this change
   NA
   
   ## What changes are included in this PR?
   This PR introduces a `temporal_duration_coercion` fn, that coerces the 
Duration unit to Timestamp unit. I've tested it with the failing queries 
mentioned in the issue.....
   
   ````SQL
   > select '2024-02-23'::date::timestamp + 
arrow_cast(arrow_cast('03:12:44'::time, 'Time32(Second)')::int, 
'Duration(Second)');
   
+---------------------------------------------------------------------------------------------------------------+
   | Utf8("2024-02-23") + 
arrow_cast(arrow_cast(Utf8("03:12:44"),Utf8("Time32(Second)")),Utf8("Duration(Second)"))
 |
   
+---------------------------------------------------------------------------------------------------------------+
   | 2024-02-23T03:12:44                                                        
                                   |
   
+---------------------------------------------------------------------------------------------------------------+
   1 row(s) fetched. 
   Elapsed 0.010 seconds.
   
   ````
   
   ````SQL
   > select '2024-02-23'::date::timestamp + arrow_cast(1234, 
'Duration(Second)');
   +-----------------------------------------------------------------------+
   | Utf8("2024-02-23") + arrow_cast(Int64(1234),Utf8("Duration(Second)")) |
   +-----------------------------------------------------------------------+
   | 2024-02-23T00:20:34                                                   |
   +-----------------------------------------------------------------------+
   1 row(s) fetched. 
   Elapsed 0.009 seconds.
   
   ````
   
   
   ## Are these changes tested?
   no, test cases are not covered for this pr.
   
   ## Are there any user-facing changes?
   no


-- 
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