liukun4515 commented on issue #3148:
URL: 
https://github.com/apache/arrow-datafusion/issues/3148#issuecomment-1634027895

   > @liukun4515 there is the `interval` constant syntax:
   > 
   > ```
   > DataFusion CLI v27.0.0
   > ❯ select interval '5 days';
   > +-------------------------------------------------------+
   > | IntervalMonthDayNano("92233720368547758080")          |
   > +-------------------------------------------------------+
   > | 0 years 0 mons 5 days 0 hours 0 mins 0.000000000 secs |
   > +-------------------------------------------------------+
   > 1 row in set. Query took 0.025 seconds.
   > ```
   > 
   > Also casting strings to intervals handle units
   > 
   > ```
   > 
   > ❯ select '5 days'::interval;
   > +-------------------------------------------------------+
   > | Utf8("5 days")                                        |
   > +-------------------------------------------------------+
   > | 0 years 0 mons 5 days 0 hours 0 mins 0.000000000 secs |
   > +-------------------------------------------------------+
   > 1 row in set. Query took 0.003 seconds.
   > ```
   > 
   > Or creating a string via `||` (which is the same as the concat you mention 
above)
   > 
   > ```
   > ❯ select (5 || ' days')::interval;
   > +-------------------------------------------------------+
   > | Int64(5) || Utf8(" days")                             |
   > +-------------------------------------------------------+
   > | 0 years 0 mons 5 days 0 hours 0 mins 0.000000000 secs |
   > +-------------------------------------------------------+
   > 1 row in set. Query took 0.004 seconds.
   > ```
   
   ` 5|| ' DAY'` is same with concat( 5, ' day') ?
   
   I use this method concat to complete my requirements, but the performance 
may be not better.
   
   
https://github.com/apache/arrow-datafusion/issues/6876#issuecomment-1631086729 
also provide the thoughts about support the `make_interval` function
   
   cc @watfordkcf 
   


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

Reply via email to