Insert to Partition #2729
Labels
api: bigquery
Issues related to the BigQuery API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
Could you add a parameter to the
Table.insert_data
method that accepts a partition label?I'm trying to write a Python app that is able to copy data from one partition in a table to another partition. I have a data field
timestamp
in my Bigquery schema and I want to query off of this value. However the partition does not always align with values in this field. Some entries with_PARTITIONTIME 2016-11-11
actually have a timestamp2016-11-10
. This is usually caused by application delay, latency, or Bigquery outages such as the one on Tuesday.Using the
bq
shell api I am able to use table decorators to target the partition directly. In the below shell example I am able to target a partition using--destination_table
and the query can limit it's select using a similar partition decorator.However in this api it's strange that I have to create 2 table instances, one to address the table (unpartitioned) and one to insert to the table. See below.
The
Table.insert_data
source code seems to just pass the table name to the underlying REST api. So assuming the REST api will accept and use the table partition decorator then the code above should insert as I expect. The api would be easier to use for my use case if it handled a partition label if one is provided at the time of insert.The text was updated successfully, but these errors were encountered: