Google Bigquery PHP API 允许的内存大小在 Google/Http/REST 中耗尽。php
Google Bigquery PHP API Allowed memory size exhausted in Google/Http/REST.php
Google Bigquery 的 PHP API 在查询作业结果时发出致命错误。实际错误是:
Fatal error: Allowed memory size of 134217728 bytes exhausted
(tried to allocate 72 bytes) in
/.../google-api-php-client-1.1.6/src/Google/Http/REST.php on
line 119
知道是什么导致了这个错误吗?
回答我自己的问题:
这是由 getQueryResults 调用返回太多行引起的。这可以通过将可选参数中的 maxResults 设置为限制值来解决,即:
response = gbq_service->jobs->getQueryResults($project_id, $jobId, array('timeoutMs' => 100000, 'maxResults'=>1000));
Google Bigquery 的 PHP API 在查询作业结果时发出致命错误。实际错误是:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /.../google-api-php-client-1.1.6/src/Google/Http/REST.php on line 119
知道是什么导致了这个错误吗?
回答我自己的问题:
这是由 getQueryResults 调用返回太多行引起的。这可以通过将可选参数中的 maxResults 设置为限制值来解决,即:
response = gbq_service->jobs->getQueryResults($project_id, $jobId, array('timeoutMs' => 100000, 'maxResults'=>1000));