You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2023/01/13 01:38:56 UTC

[GitHub] [calcite] tanclary opened a new pull request, #3025: [CALCITE-5464] Implement BigQuery DATE_ADD/DATE_DIFF

tanclary opened a new pull request, #3025:
URL: https://github.com/apache/calcite/pull/3025

   This is a draft PR for beginning work on BigQuery DATE_ADD() and DATE_DIFF() functions. DATE_ADD() is currently functioning as expected. DATE_DIFF() is facing a small issue where 'week' is not working as expected because BigQuery considers a 'week' beginning on Sunday (so the difference between dates on a Saturday and Sunday would return 1 despite only being a day apart). If anyone has any comments about this issue or any other changes I would highly appreciate it! More info about these functions is below. 
   
   DATE_ADD(date_expression, interval) adds the interval to the date expression.
   Example: DATE_ADD(DATE '2008-12-25', INTERVAL 3 DAY) would return '2008-12-28'.
   BigQuery docs: https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_add
   
   DATE_DIFF(date_expression, date_expression2, time_unit) returns the whole number of time_unit between the first and second date expressions, with the result being negative if the first date is earlier than the second.
   Example: DATE_DIFF(DATE '2008-12-25', DATE '2008-12-28', DAY) would return -3.
   BigQuery docs: https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_diff


-- 
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: commits-unsubscribe@calcite.apache.org

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


[GitHub] [calcite] tanclary closed pull request #3025: [CALCITE-5464] Implement BigQuery DATE_ADD/DATE_DIFF

Posted by "tanclary (via GitHub)" <gi...@apache.org>.
tanclary closed pull request #3025: [CALCITE-5464] Implement BigQuery DATE_ADD/DATE_DIFF
URL: https://github.com/apache/calcite/pull/3025


-- 
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: commits-unsubscribe@calcite.apache.org

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