Skip to content

Commit

Permalink
Merge pull request #95 from CartoDB/jarroyo/cluster-quadbin-tables
Browse files Browse the repository at this point in the history
Cluster "quadbin raster" table by quadbin
  • Loading branch information
francois-baptiste authored Jan 26, 2023
2 parents 6c91bb1 + 97481e7 commit 19c8a19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion raster_loader/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,14 @@ def records_to_bigquery(

data_df = pd.DataFrame(records)

job_config = bigquery.LoadJobConfig()

if "quadbin" in data_df.keys():
# Cluster table by quadbin
job_config.clustering_fields = ["quadbin"]

return client.load_table_from_dataframe(
data_df, f"{project_id}.{dataset_id}.{table_id}"
data_df, f"{project_id}.{dataset_id}.{table_id}", job_config=job_config
)


Expand Down

0 comments on commit 19c8a19

Please sign in to comment.