shyam
shyam

Reputation: 19

time partitioned BigQuery tables

Does Google Datalab support time partitioned BigQuery table's specific partition as query result destination tables ? For example:

from gcp import bigquery as bq
queryString = 'SELECT "a1" AS col1'
tabNam = 'Feature.test$20141228'
bq.Query(queryString).execute(table_name=tabNam, table_mode='create')

Upvotes: 2

Views: 446

Answers (2)

Haipeng Su
Haipeng Su

Reputation: 2541

There is great feature for tables in Google Big Query. If you have several tables with the same name + (Date), e.g test20141228, test20141229... You will have a set of tables with a scroll down button, as shown in the pic, which is really nice. Then you can use wild card function TABLE_DATE_RANGE([Feature.test], date1, date2) to query tables between testdate1 ~ testdate2, which is also really nice.

enter image description here

Upvotes: 0

Mikhail Berlyant
Mikhail Berlyant

Reputation: 172974

My guess is that this feature is not needed to be somehow specially supported by Datalab, because the only what you need to do is to supply table name with time partition as suffix (like you have it in your question - Feature.test$20141228). Of course you need to make sure first that your table (Feature.test) is properly configured with timePartitioning table's property

Upvotes: 1

Related Questions