googleapis / python-bigquery-sqlalchemy

SQLAlchemy dialect for BigQuery
MIT License
434 stars 129 forks source link

Add capability to partition tables by the full spectrum of supported capabilities #1072

Open chalmerlowe opened 5 months ago

chalmerlowe commented 5 months ago

As noted in this Issue/PR, this library was found to be unable to partition according to a specific granularity, despite that being part of the BigQuery (BQ) API.

During investigation into the above Issue, it was found that the library was missing additional capabilities as reflected this matrix.

Add capabilities noted in the matrix to partition tables by the full spectrum of supported BQ capabilities.

Column Data Type HOUR DAY MONTH YEAR
DATE N/A Fixed by https://github.com/googleapis/python-bigquery-sqlalchemy/pull/1057 via DATE_TRUNC via DATE_TRUNC
DATETIME Incorrectly implemented via DATE_TRUNC TODO: use  DATETIME_TRUNC Incorrectly implemented via DATE_TRUNC TODO: use  DATETIME_TRUNC Incorrectly implemented via DATE_TRUNC TODO: use  DATETIME_TRUNC Incorrectly implemented via DATE_TRUNC TODO: use  DATETIME_TRUNC
TIMESTAMP via TIMESTAMP_TRUNC via TIMESTAMP_TRUNC via TIMESTAMP_TRUNC via TIMESTAMP_TRUNC
_PARTITIONDATE N/A via DATE_TRUNC via DATE_TRUNC via DATE_TRUNC
_PARTITIONTIME Not currently implemented TODO: USE TIMESTAMP_TRUNC Not currently implemented TODO: USE TIMESTAMP_TRUNC Not currently implemented TODO: USE TIMESTAMP_TRUNC Not currently implemented TODO: USE TIMESTAMP_TRUNC