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

   ### Describe the bug
   
   Fractional seconds with microsecond or nanosecond precision are not support, 
such as:
   
   ```sql
   SELECT DATE_BIN(INTERVAL '0.000000010 seconds', TIMESTAMP '2022-08-03 
14:38:50.000000016Z', TIMESTAMP '1970-01-01T00:00:00Z')
   ```
   
   Additionally, the units `microsecond`, `microseconds`, `nanosecond` and 
`nanoseconds` are not supported:
   
   `date_bin('500 nanoseconds', column1)` or `date_bin('500 microseconds', 
column1)`
   
   ### To Reproduce
   
   ```sql
   SELECT DATE_BIN(INTERVAL '0.000000010 seconds', TIMESTAMP '2022-08-03 
14:38:50.000000016Z', TIMESTAMP '1970-01-01T00:00:00Z')
   ```
   
   returns
   
   ```
   Error during planning: Coercion from [Interval(MonthDayNano), 
Timestamp(Nanosecond, None), Timestamp(Nanosecond, None)] to the signature 
Exact([Interval(DayTime), Timestamp(Nanosecond, None), Timestamp(Nanosecond, 
None)]) failed.
   ```
   
   ### Expected behavior
   
   I expect `date_bin('0.000000010 seconds')` or `date_bin('10 nanoseconds')` 
such that the SQL:
   
   ```sql
   SELECT DATE_BIN(INTERVAL '0.000000010 seconds', TIMESTAMP '2022-08-03 
14:38:50.000000016Z', TIMESTAMP '1970-01-01T00:00:00Z')
   ```
   
   or 
   
   ```sql
   SELECT DATE_BIN(INTERVAL '10 nanoseconds', TIMESTAMP '2022-08-03 
14:38:50.000000016Z', TIMESTAMP '1970-01-01T00:00:00Z')
   ```
   
   returns the following result:
   
   ```
   2022-08-03T14:38:50.000000010
   ```
   
   ### 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