jiangzhx opened a new issue, #7097:
URL: https://github.com/apache/arrow-datafusion/issues/7097

   ### Is your feature request related to a problem or challenge?
   
   I’d like to ask if there is a way to get a result similar to `datediff` 
function , also it seems that this function is not available in DataFusion.
   
   i try another way like this,but how can i get 6  days from  interval  result
   ```
   select to_timestamp(now())-to_timestamp('2023-07-20T05:44:00.419557');
   
   +------------------------------------------------------------------------+   
                                                                                
          
   | to_timestamp(now()) - to_timestamp(Utf8("2023-07-20T05:44:00.419557")) |   
                                                                                
          
   +------------------------------------------------------------------------+   
                                                                                
          
   | 0 years 0 mons 6 days 0 hours 51 mins 7.343851000 secs                 |   
                                                                                
          
   +------------------------------------------------------------------------+   
        
   ```                                                                          
        
   
   ### Describe the solution you'd like
   
   something like `date_diff` 
    
   
   ### Describe alternatives you've considered
   
   add udf like `date_diff`
   or 
   make 
   `select extract(day from interval '1 days' ); `
   work
   ```
   
   Error during planning: No function matches the given name and argument types 
'date_part(Utf8, Interval(MonthDayNano))'. You might need to add explicit type 
casts.
           Candidate functions:
           date_part(Utf8, Date32)
           date_part(Utf8, Date64)
           date_part(Utf8, Timestamp(Second, None))
           date_part(Utf8, Timestamp(Microsecond, None))
           date_part(Utf8, Timestamp(Millisecond, None))
           date_part(Utf8, Timestamp(Nanosecond, None))
           date_part(Utf8, Timestamp(Nanosecond, Some("+00:00")))
   
   ```
   
   ### Additional context
   
   _No response_


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