googleapis / googleapis/google-cloud-python

Support INTERVAL data type

Abierto
#15,740 12 comentarios 2 reacciones 1 asignado Reclamado por @tswast Ver en GitHub
api: bigquery type: feature request
Lenguaje dominante
Python
Estrellas
5.4k
Forks
1.8k
Merge medio
3 d 4 h
PR fusionados (30 d)
122

Descripción

"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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.