googleapis / googleapis/google-cloud-python

Support INTERVAL data type

未关闭
#15,740 12 条评论 2 个 reaction 已指派 1 人 已被 @tswast 认领 在 GitHub 查看
api: bigquery type: feature request
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
122

描述

"BigQuery now supports the [INTERVAL](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#interval_type) type, which represents a duration or an amount of time. This type is in Preview."

https://cloud.google.com/bigquery/docs/release-notes#July_27_2021

Name | Range
-- | --
INTERVAL | -10000-0 -3660000 -87840000:0:0 to 10000-0 3660000 87840000:0:0

An INTERVAL object represents duration or amount of time. Interval is composed of three independent parts:

  • [sign]Y-M: Years and Months
  • [sign]D: Days
  • [sign]H:M:S.F: Hours, Minutes, Seconds and Subseconds.

Canonical format
[sign]Y-M [sign]D [sign]H:M:S[.F]
  • Y: Year
  • M: Month
  • D: Day
  • H: Hour
  • M: Minute
  • S: Second
  • [.F]: Up to six fractional digits (microsecond precision)

TODO:

- [ ] Add relevant enums for data types
- [ ] Row data is converted to relevant type in RowIterator (`list_rows()`) https://github.com/googleapis/python-bigquery/pull/840
- [ ] Convert data type in query parameters
- [ ] Covert data type in `insert_rows`

Edit: Removed pandas, arrow, db-api support in favor of https://github.com/googleapis/google-cloud-python/issues/15279, as those implementations are currently blocked on Arrow and the BQ Storage API.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。