Google\Cloud\BigQuery\QueryResults::reload PHP Method

reload() public method

Useful when needing to poll an incomplete query for status. Configuration options will be inherited from {@see \Google\Cloud\BigQuery\Job::queryResults()} or {@see \Google\Cloud\BigQuery\BigQueryClient::runQuery()}, but they can be overridden if needed. Example: $queryResults->isComplete(); // returns false sleep(1); // let's wait for a moment... $queryResults->reload(); // executes a network request if ($queryResults->isComplete()) { echo "Query complete!"; }
See also: https://cloud.google.com/bigquery/docs/reference/v2/jobs/getQueryResults Jobs getQueryResults API documentation.
public reload ( array $options = [] ) : array
$options array [optional] { Configuration options. @type int $maxResults Maximum number of results to read. @type int $startIndex Zero-based index of the starting row. @type int $timeoutMs How long to wait for the query to complete, in milliseconds. **Defaults to** `10000` milliseconds (10 seconds). }
return array
    public function reload(array $options = [])
    {
        $options += $this->identity;
        return $this->info = $this->connection->getQueryResults($options + $this->reloadOptions);
    }