Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bigquery date #52

Open
tiboun opened this issue Dec 2, 2024 · 1 comment
Open

bigquery date #52

tiboun opened this issue Dec 2, 2024 · 1 comment

Comments

@tiboun
Copy link
Contributor

tiboun commented Dec 2, 2024

When manipulating with bigquery date function we have a date as output.

SELECT DATE_SUB(DATE '2008-12-25', INTERVAL 5 DAY) AS five_days_ago

When it gets translated to duckdb

SELECT DATE_ADD(DATE '2008-12-25', INTERVAL '-5 DAY') AS five_days_ago

duckdb returns a timestamp

SELECT typeof(DATE_ADD(DATE '2008-12-25', INTERVAL '-5 DAY')) AS five_days_ago

Expecting transpilation is :

SELECT DATE_ADD(DATE '2008-12-25', INTERVAL '-5 DAY')::DATE AS five_days_ago
@manticore-projects
Copy link
Collaborator

The main question is: what happens when adding a Day fraction, like adding 1 hour only.
Second question is: what happens when first parameter is a timestamp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants