You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "waitingkuo (via GitHub)" <gi...@apache.org> on 2023/04/16 14:26:10 UTC

[GitHub] [arrow-datafusion] waitingkuo commented on pull request #5982: feat: support month and year interval for date_bin on constant data

waitingkuo commented on PR #5982:
URL: https://github.com/apache/arrow-datafusion/pull/5982#issuecomment-1510399250

   @alamb thank you for pining me. @NGA-TRAN  thank you for the great works. the codes looks good to me. 
   
   i tested this in your branch, i wonder whether this corner cases make sense
   
   ```bash
   ❯ select date_bin('1 month', timestamp '2000-02-29T00:00:00', timestamp '2000-01-31T00:00:00');
   +----------------------------------------------------------------------------------+
   | datebin(Utf8("1 month"),Utf8("2000-02-29T00:00:00"),Utf8("2000-01-31T00:00:00")) |
   +----------------------------------------------------------------------------------+
   | 2000-02-29T00:00:00                                                              |
   +----------------------------------------------------------------------------------+
   1 row in set. Query took 0.003 seconds.
   ```
   
   ```bash
   ❯ select date_bin('1 month', timestamp '2000-01-31T00:00:00', timestamp '2000-02-29T00:00:00');
   +----------------------------------------------------------------------------------+
   | datebin(Utf8("1 month"),Utf8("2000-01-31T00:00:00"),Utf8("2000-02-29T00:00:00")) |
   +----------------------------------------------------------------------------------+
   | 2000-01-29T00:00:00                                                              |
   +----------------------------------------------------------------------------------+
   1 row in set. Query took 0.003 seconds.
   ```
   
   i feel like the mechanism behind isn't consistent. i thought that the second's is `2000-01-31T00:00:00`


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org