Skip to content

Commit

Permalink
feat(batch-exports): Partition created table by timestamp (#17814)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias authored Oct 5, 2023
1 parent 4ecfb63 commit 5256e51
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions posthog/temporal/workflows/bigquery_batch_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def create_table_in_bigquery(
"""Create a table in BigQuery."""
fully_qualified_name = f"{project_id}.{dataset_id}.{table_id}"
table = bigquery.Table(fully_qualified_name, schema=table_schema)
table.time_partitioning = bigquery.TimePartitioning(type_=bigquery.TimePartitioningType.DAY, field="timestamp")
table = bigquery_client.create_table(table, exists_ok=exists_ok)

return table
Expand Down

0 comments on commit 5256e51

Please sign in to comment.