use Google\Cloud\BigQuery\BigQueryClient;
$bigQuery = new BigQueryClient();
Namespace
Google \ Cloud \ BigQuery
Methods
__construct
Create a BigQuery client.
Parameters
Name
Description
config
array Configuration options.
↳ apiEndpoint
string The hostname with optional port to use in place of the default service endpoint. Example: foobar.com or foobar.com:1234.
↳ projectId
string The project ID from the Google Developer's Console.
↳ authCache
CacheItemPoolInterface A cache for storing access tokens. Defaults to a simple in memory implementation.
↳ authCacheOptions
array Cache configuration options.
↳ authHttpHandler
callable A handler used to deliver Psr7 requests specifically for authentication.
↳ credentialsFetcher
FetchAuthTokenInterface A credentials fetcher instance.
↳ httpHandler
callable A handler used to deliver Psr7 requests. Only valid for requests sent over REST.
↳ keyFile
array The contents of the service account credentials .json file retrieved from the Google Developer's Console. Ex: json_decode(file_get_contents($path), true).
↳ keyFilePath
string The full path to your service account credentials .json file retrieved from the Google Developers Console.
↳ requestTimeout
float Seconds to wait before timing out the request. Defaults to 0 with REST and 60 with gRPC.
↳ retries
int Number of retries for a failed request. Defaults to 3.
↳ scopes
array Scopes to be used for the request.
↳ quotaProject
string Specifies a user project to bill for access charges associated with the request.
↳ returnInt64AsObject
bool If true, 64 bit integers will be returned as a Google\Cloud\Core\Int64 object for 32 bit platform compatibility. Defaults to false.
↳ location
string If provided, determines the default geographic location used when creating datasets and managing jobs. Please note: This is only required for jobs started outside of the US and EU regions. Also, if location metadata has already been fetched over the network it will take precedent over this setting (by calling Table::reload(), for example).
Unless otherwise specified, all configuration options will default based on thequery job configurationexcept for configuration.query.useLegacySql, which defaults to falsein this client.
Example:
'SELECT commit FROM `bigquery-public-data.github_repos.commits` LIMIT 100'
);
Unless otherwise specified, all configuration options will default based on thequery job configurationexcept for configuration.query.useLegacySql, which defaults to falsein this client.
int The maximum number of rows to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large.
↳ startIndex
int Zero-based index of the starting row.
↳ timeoutMs
int How long, in milliseconds, each API call will wait for query results to become available before timing out. Depending on whether the $maxRetries has been exceeded, the results will be polled again after the timeout has been reached. Defaults to 10000 milliseconds (10 seconds).
↳ maxRetries
int The number of times to poll the Job status, until the job is complete. By default, will poll indefinitely.
↳ returnRawResults
bool Returns the raw data types returned from BigQuery without converting their values into native PHP types or the custom type classes supported by this library.
There are no network requests made at this point. To see the operations that can be performed on a job please see Job.
Example:
Parameters
Name
Description
id
string The id of the already run or running job to request.
options
array Configuration options.
↳ location
string The geographic location of the job. Required for jobs started outside of the US and EU regions. Defaults to a location specified in the client configuration.
Numeric represents a value with a data type ofNumeric.
It supports a fixed 38 decimal digits of precision and 9 decimal digits of scale, and values are in the range of -99999999999999999999999999999.999999999 to 99999999999999999999999999999.999999999.
Example:
Parameter
Name
Description
value
string|int
Returns
Type
Description
numeric
bigNumeric
Create a BigNumeric object.
Numeric represents a value with a data type ofBIGNUMERIC.
It supports 76.76 (the 77th digit is partial) decimal digits of precision and 38 decimal digits of scale. Values are in the range of -5.7896044618658097711785492504343953926634992332820282019728792003956564819968E+38 to 5.7896044618658097711785492504343953926634992332820282019728792003956564819967E+38.