-
Notifications
You must be signed in to change notification settings - Fork 182
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 datetime prior to 1970-01-01 #285
Labels
Comments
Minimal reprex: library(bigrquery)
sql <- "
SELECT `peak_datetime`, SAFE_CAST(`peak_datetime` AS STRING) AS `string`
FROM `bigquery-public-data.moon_phases.moon_phases`
WHERE (`peak_datetime` < '1970-01-01')
LIMIT 10
"
job <- bq_project_query(bq_test_project(), sql)
bq_table_download(job) |
Simpler reprex: dt <- as.POSIXct("1901-01-01")
bq_parse_single(as.character(dt, "%Y-%m-%dT%H:%M:%S"), "datetime") |
hadley
added a commit
that referenced
this issue
Jan 23, 2019
The root cause of this is the C function |
Argh, that appears to be true on OS X, but not linux 😬 |
hadley
added a commit
that referenced
this issue
Nov 9, 2023
Merged
hadley
added a commit
that referenced
this issue
Nov 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BigQuery tables containing
DATETIME
column with dates prior to 1970-01-01 do not get stored in data frames correctly. Datetimes before the UNIX epoch default to 1969-12-31 23:59:59.Filtering based on this column still behaves as expected, but the wrong datetime is displayed/stored. Mutating a column specifying that a string is desired reveals the expected datetime string.
The text was updated successfully, but these errors were encountered: