Follow-up to #15740 since pandas and Arrow do not yet have a structured type that aligns with INTERVAL. The existing Timedelta support would work for INTERVALS with only a time component, but it is not calendar aware, so supporting year, month, and day intervals would require some mapping to timedelta, which is not ideal.
Why is a new data type needed?
- YEAR: Leap years are a thing. Not every year is 365 days long.
- MONTH: Not every month is the same length.
- DAY: Daylight savings is a thing. Not every day is 24 hours long.
Note: DB-API support is included here because it uses the BigQuery Storage API, where we use the Arrow wire format.
TODO:
Follow-up to #15740 since pandas and Arrow do not yet have a structured type that aligns with
INTERVAL. The existing Timedelta support would work for INTERVALS with only a time component, but it is not calendar aware, so supporting year, month, and day intervals would require some mapping to timedelta, which is not ideal.Why is a new data type needed?
Note: DB-API support is included here because it uses the BigQuery Storage API, where we use the Arrow wire format.
TODO:
to_dataframeobject, sincetimedelta64doesn't have years/months.to_arrowtype is expected datatypeinsert_rows_from_dataframeload_rows_from_dataframe(CSV)load_rows_from_dataframe(Parquet)