PHP 클래스 Google\Cloud\BigQuery\QueryResults

This class should be not instantiated directly, but as a result of calling {@see \Google\Cloud\BigQuery\BigQueryClient::runQuery()} or {@see \Google\Cloud\BigQuery\Job::queryResults()}.
파일 보기 프로젝트 열기: GoogleCloudPlatform/gcloud-php

보호된 프로퍼티들

프로퍼티 타입 설명
$connection Google\Cloud\BigQuery\Connection\ConnectionInterface Represents a connection to BigQuery.

공개 메소드들

메소드 설명
__construct ( Google\Cloud\BigQuery\Connection\ConnectionInterface $connection, string $jobId, string $projectId, array $info, array $reloadOptions, ValueMapper $mapper )
identity ( ) : array Retrieves the query result's identity.
info ( ) : array Retrieves the cached query details.
isComplete ( ) : boolean Checks the query's completeness. Useful in combination with {@see Google\Cloud\BigQuery\QueryResults::reload()} to poll for query status.
reload ( array $options = [] ) : array Triggers a network request to reload the query's details.
rows ( array $options = [] ) : array Retrieves the rows associated with the query and merges them together with the table's schema. It is recommended to check the completeness of the query before attempting to access rows.

메소드 상세

__construct() 공개 메소드

public __construct ( Google\Cloud\BigQuery\Connection\ConnectionInterface $connection, string $jobId, string $projectId, array $info, array $reloadOptions, ValueMapper $mapper )
$connection Google\Cloud\BigQuery\Connection\ConnectionInterface Represents a connection to BigQuery.
$jobId string The job's ID.
$projectId string The project's ID.
$info array The query result's metadata.
$reloadOptions array The options to use when reloading query data.
$mapper ValueMapper Maps values between PHP and BigQuery.

identity() 공개 메소드

An identity provides a description of a nested resource. Example: echo $queryResults->identity()['projectId'];
public identity ( ) : array
리턴 array

info() 공개 메소드

Example: $info = $queryResults->info(); echo $info['totalBytesProcessed'];
또한 보기: https://cloud.google.com/bigquery/docs/reference/v2/jobs/getQueryResults#response Jobs getQueryResults API response documentation.
public info ( ) : array
리턴 array

isComplete() 공개 메소드

Example: $isComplete = $queryResults->isComplete(); while (!$isComplete) { sleep(1); // small delay between requests $queryResults->reload(); $isComplete = $queryResults->isComplete(); } echo 'Query complete!';
public isComplete ( ) : boolean
리턴 boolean

reload() 공개 메소드

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!"; }
또한 보기: 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). }
리턴 array

rows() 공개 메소드

Refer to the table below for a guide on how BigQuery types are mapped as they come back from the API. | **PHP Type** | **BigQuery Data Type** | |--------------------------------------------|--------------------------------------| | \DateTimeInterface | DATETIME | | {@see \Google\Cloud\BigQuery\Bytes} | BYTES | | {@see \Google\Cloud\BigQuery\Date} | DATE | | {@see \Google\Cloud\Int64} | INTEGER | | {@see \Google\Cloud\BigQuery\Time} | TIME | | {@see \Google\Cloud\BigQuery\Timestamp} | TIMESTAMP | | Associative Array | RECORD | | Non-Associative Array | RECORD (Repeated) | | float | FLOAT | | int | INTEGER | | string | STRING | | bool | BOOLEAN | Example: $isComplete = $queryResults->isComplete(); if ($isComplete) { $rows = $queryResults->rows(); foreach ($rows as $row) { echo $row['name'] . PHP_EOL; } }
public rows ( array $options = [] ) : array
$options array [optional] Configuration options.
리턴 array

프로퍼티 상세

$connection 보호되어 있는 프로퍼티

Represents a connection to BigQuery.
protected ConnectionInterface,Google\Cloud\BigQuery\Connection $connection
리턴 Google\Cloud\BigQuery\Connection\ConnectionInterface