File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -577,7 +577,9 @@ def to_pandas_batches(
577
577
see https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.job.QueryJob#google_cloud_bigquery_job_QueryJob_result"""
578
578
dtypes = dict (zip (self .index_columns , self .index .dtypes ))
579
579
dtypes .update (zip (self .value_columns , self .dtypes ))
580
- _ , query_job = self .session ._execute (self .expr , ordered = True )
580
+ _ , query_job = self .session ._executor .execute (
581
+ self .expr , ordered = True , use_explicit_destination = True
582
+ )
581
583
results_iterator = query_job .result (
582
584
page_size = page_size , max_results = max_results
583
585
)
Original file line number Diff line number Diff line change @@ -1324,6 +1324,7 @@ def _execute(
1324
1324
* ,
1325
1325
ordered : bool = True ,
1326
1326
col_id_overrides : Mapping [str , str ] = {},
1327
+ use_explicit_destination : bool = False ,
1327
1328
) -> tuple [bigquery .table .RowIterator , bigquery .QueryJob ]:
1328
1329
return self ._executor .execute (
1329
1330
array_value ,
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ def execute(
102
102
* ,
103
103
ordered : bool = True ,
104
104
col_id_overrides : Mapping [str , str ] = {},
105
+ use_explicit_destination : bool = False ,
105
106
):
106
107
"""
107
108
Execute the ArrayValue, storing the result to a temporary session-owned table.
@@ -113,6 +114,13 @@ def execute(
113
114
array_value , ordered = ordered , col_id_overrides = col_id_overrides
114
115
)
115
116
job_config = bigquery .QueryJobConfig ()
117
+ # Use explicit destination to avoid 10GB limit of temporary table
118
+ if use_explicit_destination :
119
+ schema = array_value .schema .to_bigquery ()
120
+ destination_table = self .storage_manager .create_temp_table (
121
+ schema , cluster_cols = []
122
+ )
123
+ job_config .destination = destination_table
116
124
# TODO(swast): plumb through the api_name of the user-facing api that
117
125
# caused this query.
118
126
return self ._run_execute_query (
You can’t perform that action at this time.
0 commit comments