BigQuery Connector Reference¶
The following operations allow you to work with the BigQuery Connector. Click an operation name to see parameter details and samples on how to use it.
Initialize the connector¶
To use the BigQuery connector, add the
The BigQuery API requires all requests to be authenticated as a user or a service account. For more information, see https://cloud.google.com/bigquery/authentication. See https://developers.google.com/identity/protocols/OAuth2ServiceAccount for information on service account authentication. For more information, see related BigQuery documentation.
init
The init operation is used to initialize the connection to BigQuery.
Sample configuration
<bigquery.init>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<accessToken>{$ctx:accessToken}</accessToken>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<client>{$ctx:clientId}</clientId>
<refreshToken>{$ctx:refreshToken}</refreshToken>
<registryPath>{$ctx:registryPath}</registryPath>
<fields>{$ctx:fields}</fields>
<prettyPrint>{$ctx:prettyPrint}</prettyPrint>
<quotaUser>{$ctx:quotaUser}</quotaUser>
<userIp>{$ctx:userIp}</userIp>
</bigquery.init>
Parameter Name | Description | Required |
---|---|---|
apiUrl | The base endpoint URL of the BigQuery API. | Yes |
accessToken | The OAuth token for the BigQuery API. | Yes |
clientId | The client ID for the BigQuery API. | Yes |
clientSecret | The client secret for the BigQuery API. | Yes |
refreshToken | The refresh token for the BigQuery API. | Yes |
registryPath | The registry path to save the access token. | Yes |
fields | List of fields to be returned in the response. | Yes |
callback | The name of the JavaScript callback function that handles the response. Used in JavaScript JSON-P requests. | Yes |
apiKey | The API key. Required unless you provide an OAuth 2.0 token. | Yes |
prettyPrint | Returns the response with indentations and line breaks. If the property is true, the response is returned in a human-readable format. | Yes |
quotaUser | Alternative to userIp. Lets you enforce per-user quotas from a server-side application even in cases where the user's IP address is unknown. | Yes |
userIp | IP address of the end user for whom the API call is being made. Lets you enforce per-user quotas when calling the API from a server-side application. | Yes |
ifMatch | Etag value to use for returning a page of list values if the values have not changed. | Yes |
ifNoneMatch | Etag value to use for returning a page of list values if the values have changed. | Yes |
Alternatively, you can use the following operation (getAccessTokenFromServiceAccount) to get the access token and to do all the other operations.
<bigquery.getAccessTokenFromServiceAccount>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<keyStoreLocation>{$ctx:keyStoreLocation}</keyStoreLocation>
<serviceAccount>{$ctx:serviceAccount}</serviceAccount>
<scope>{$ctx:scope}</scope>
<accessTokenRegistryPath>{$ctx:accessTokenRegistryPath}</accessTokenRegistryPath>
</bigquery.getAccessTokenFromServiceAccount>
Parameter Name | Description | Required |
---|---|---|
apiUrl | The base endpoint URL of the BigQuery API. | Yes |
keyStoreLocation | The location where the p12 key file is located. | Yes |
serviceAccount | The value of the service account. | Yes |
scope | The space delimited scope to access the API. | Yes |
accessTokenRegistryPath | The registry path to store the access token (this is an optional parameter). | Yes |
You can also use the below operation (getAccessTokenFromAuthorizationCode) to get the access token and to do all the other operations.
<bigquery.getAccessTokenFromAuthorizationCode>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<authorizationCode>{$ctx:authorizationCode}</authorizationCode>
<redirectUrl>{$ctx:redirectUrl}</redirectUrl>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<clientId>{$ctx:clientId}</clientId>
<registryPath>{$ctx:registryPath}</registryPath>
</bigquery.getAccessTokenFromAuthorizationCode>
Parameter Name | Description | Required |
---|---|---|
apiUrl | The base endpoint URL of the BigQuery API. | Yes |
authorizationCode | The authorization code to be used for obtaining the access token. | Yes |
redirectUrl | The redirect URL to be used in the OAuth 2.0 authorization flow. | Yes |
clientSecret | The space delimited scope to access the API. | Yes |
clientId | The registry path to store the access token (this is an optional parameter). | Yes |
registryPath | The registry path to store the access token (this is an optional parameter). | Yes |
You can also use the below operation (getAccessTokenFromRefreshToken) to get the access token and to do all the other operations.
<bigquery.getAccessTokenFromRefreshToken>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<clientId>{$ctx:clientId}</clientId>
<refreshToken>{$ctx:refreshToken}</refreshToken>
</bigquery.getAccessTokenFromRefreshToken>
Parameter Name | Description | Required |
---|---|---|
apiUrl | The base endpoint URL of the BigQuery API. | Yes |
clientSecret | The space delimited scope to access the API. | Yes |
clientId | The registry path to store the access token (this is an optional parameter). | Yes |
refreshToken | The refresh token for the BigQuery API. | Yes |
Sample request
{
"apiUrl": "https://www.googleapis.com",
"clientId": "504627865627-kdni8r2s10sjcgd4v6stthdaqb4bvnba.apps.googleusercontent.com",
"refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
"clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM"
}
Datasets¶
getDataset
The getDataset operation retrieves a dataset. For more information, see related BigQuery documentation.
Parameter Name | Description | Required |
---|---|---|
projectId | The ID of the project to which the dataset belongs. | Yes. |
datasetId | The ID of the dataset. | Yes. |
Sample configurations
<bigquery.getDataset>
<projectId>{$ctx:projectId}</projectId>
<datasetId>{$ctx:datasetId}</datasetId>
</bigquery.getDataset>
Sample request
{
"accessToken": "ya29.BwKYx40Dith1DFQBDjZOHNqhcxmKs9zbkjAWQa1q8mdMFndp2-q8ifG66fwprOigRwKSNw",
"apiUrl": "https://www.googleapis.com",
"clientId": "504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com",
"clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM",
"refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
"registryPath": "connectors/bq",
"projectId": "publicdata",
"datasetId": "samples",
"fields": "id",
"callback": "callBackFunction",
"apiKey": "154987fd5h4x6gh4",
"prettyPrint": "true",
"quotaUser": "1hx46f5g4h5ghx6h41x54gh6f4hx",
"userIp": "192.77.88.12",
"ifNoneMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8",
"ifMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8"
}
Sample response
{
"kind": "bigquery#dataset",
"etag": "1xuEK5ngZZ+fj0iioOa6Og==",
"id": "testbig-235116:testData",
"selfLink": "https://content.googleapis.com/bigquery/v2/projects/testbig-235116/datasets/testData",
"datasetReference": {
"datasetId": "testData",
"projectId": "testbig-235116"
},
"defaultTableExpirationMs": "5184000000",
"access": [
{
"role": "WRITER",
"specialGroup": "projectWriters"
},
{
"role": "OWNER",
"specialGroup": "projectOwners"
},
{
"role": "OWNER",
"userByEmail": "[email protected]"
},
{
"role": "READER",
"specialGroup": "projectReaders"
}
],
"creationTime": "1553104741840",
"lastModifiedTime": "1553104741840",
"location": "US",
"defaultPartitionExpirationMs": "5184000000"
}
listDatasets
The listDatasets operation lists a set of data. For more information, see related BigQuery documentation.
Parameter Name | Description | Required |
---|---|---|
projectId | The ID of the project to which the dataset belongs. | Yes. |
maxResults | The maximum number of results per page. | Yes. |
pageToken | The page token value. | Yes. |
isAll | A boolean value that determines whether to list all datasets, including hidden ones. | Yes. |
Sample configurations
<bigquery.listDatasets>
<projectId>{$ctx:projectId}</projectId>
<maxResults>{$ctx:maxResults}</maxResults>
<pageToken>{$ctx:pageToken}</pageToken>
<isAll>{$ctx:isAll}</isAll>
</bigquery.listDatasets>
Sample request
{
"accessToken": "ya29.BwKYx40Dith1DFQBDjZOHNqhcxmKs9zbkjAWQa1q8mdMFndp2-q8ifG66fwprOigRwKSNw",
"apiUrl": "https://www.googleapis.com",
"clientId": "504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com",
"clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM",
"refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
"registryPath": "connectors/bq",
"projectId": "publicdata",
"maxResults": "1",
"pageToken": "1",
"isAll": "true",
"fields": "datasets/datasetReference",
"callback": "callBackFunction",
"apiKey": "154987fd5h4x6gh4",
"prettyPrint": "true",
"quotaUser": "1hx46f5g4h5ghx6h41x54gh6f4hx",
"userIp": "192.77.88.12",
"ifNoneMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8",
"ifMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8"
}
Sample response
{
"kind": "bigquery#datasetList",
"etag": "5xsXo/uZ5RUfG49EzOV9Gg==",
"datasets": [
{
"kind": "bigquery#dataset",
"id": "testbig-235116:testData",
"datasetReference": {
"datasetId": "testData",
"projectId": "testbig-235116"
},
"location": "US"
}
]
}
Jobs¶
runQuery
The runQuery operation runs an SQL query (BigQuery) and returns results if the query completes within a specified timeout. For more information, see related BigQuery documentation.
Parameter Name | Description | Required |
---|---|---|
useQueryCache | Specifies whether to look for the result in the query cache. The default value is true. | Yes. |
timeoutMs | Specifies how long (in milliseconds) the system should wait for the query to complete before expiring and returning the request. | Yes. |
query | A query string (required) that complies with the BigQuery query syntax. | Yes. |
dryRun | If set to true, BigQuery does not run the job. Instead, if the query is valid, BigQuery returns statistics about the job. If the query is invalid, an error returns. The default value is false. | Yes. |
defaultProjectId | The ID of the project that contains this dataset. | Yes. |
defaultDatasetId | A unique ID (required) for this dataset without the project name. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters. | Yes. |
projectId | The ID of the project that is billed for the query. | Yes. |
maxResults | The maximum number of rows of data (results) to return per page. Responses are also limited to 10 MB. By default, there is no maximum row count and only the byte limit applies. | Yes. |
kind | The resource type of the request. | Yes. |
useLegacySql | Specifies whether to use BigQuery's legacy SQL dialect for this query. The default value is true. If set to false, the query will use BigQuery's standard SQL. For information on BigQuery's standard SQL, see https://cloud.google.com/bigquery/docs/reference/standard-sql/migrating-from-legacy-sql. | Yes. |
Sample configurations
<bigquery.runQuery>
<useQueryCache>{$ctx:useQueryCache}</useQueryCache>
<timeoutMs>{$ctx:timeoutMs}</timeoutMs>
<query>{$ctx:query}</query>
<dryRun>{$ctx:dryRun}</dryRun>
<defaultProjectId>{$ctx:defaultProjectId}</defaultProjectId>
<defaultDatasetId>{$ctx:defaultDatasetId}</defaultDatasetId>
<projectId>{$ctx:projectId}</projectId>
<maxResults>{$ctx:maxResults}</maxResults>
<kind>{$ctx:kind}</kind>
<useLegacySql>{$ctx:useLegacySql}</useLegacySql>
</bigquery.runQuery>
Sample request
{
"quotaUser":"1hx46f5g4h5ghx6h41x54gh6f4hx",
"userIp":"192.77.88.12",
"accessToken":"ya29.6QFjdRjTZyXmIjxkO6G6dJoLrch1Ktt1IzFm",
"clientId": "504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com",
"clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM",
"refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
"registryPath": "connectors/bq",
"prettyPrint":"true",
"callback":"callBackFunction",
"apiUrl":"https://www.googleapis.com",
"fields":"id,etag",
"useQueryCache":"true",
"timeoutMs":"10000",
"query":"SELECT count(*) FROM [publicdata:samples.github_nested]",
"dryRun":"false",
"defaultProjectId":"bigqueryproject-1092",
"defaultDatasetId":"test_100",
"projectId":"bigqueryproject-1092",
"maxResults":"10000",
"kind":"bigquery#queryRequest",
"ifNoneMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8",
"ifMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8"
}
Sample response
{
"kind": "bigquery#queryResponse",
"schema": {
"fields": [
{
"name": "Name",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "Age",
"type": "INTEGER",
"mode": "NULLABLE"
}
]
},
"jobReference": {
"projectId": "testbig-235116",
"jobId": "job_GECobzPaLdbBW-SqIG-WrfOzaqtQ",
"location": "US"
},
"totalRows": "2",
"rows": [
{
"f": [
{
"v": "John"
},
{
"v": "45"
}
]
},
{
"f": [
{
"v": "Harry"
},
{
"v": "25"
}
]
}
],
"totalBytesProcessed": "670",
"jobComplete": true,
"cacheHit": false
}
Projects¶
listProjects
The listProjects operation retrieves all projects. For more information, see related BigQuery documentation.
Parameter Name | Description | Required |
---|---|---|
maxResults | The maximum number of results per page. | Yes. |
pageToken | The page token value. | Yes. |
Sample configurations
<bigquery.listProjects>
<maxResults>{$ctx:maxResults}</maxResults>
<pageToken>{$ctx:pageToken}</pageToken>
</bigquery.listProjects>
Sample request
{
"accessToken" : "ya29.BwKYx40Dith1DFQBDjZOHNqhcxmKs9zbkjAWQa1q8mdMFndp2-q8ifG66fwprOigRwKSNw",
"apiUrl" : "https://www.googleapis.com",
"clientId": "504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com",
"clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM",
"refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
"registryPath": "connectors/bq",
"maxResults" : "1",
"pageToken" : "1",
"fields": "id",
"callback": "callBackFunction",
"apiKey": "154987fd5h4x6gh4",
"prettyPrint": "true",
"quotaUser": "1hx46f5g4h5ghx6h41x54gh6f4hx",
"userIp": "192.77.88.12",
"ifNoneMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8",
"ifMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8"
}
Sample response
{
"kind": "bigquery#projectList",
"etag": "jdhx8JpxmSC6iJhWFNchpw==",
"projects": [
{
"kind": "bigquery#project",
"id": "ascendant-lore-235117",
"numericId": "719690246975",
"projectReference": {
"projectId": "ascendant-lore-235117"
},
"friendlyName": "My First Project"
},
{
"kind": "bigquery#project",
"id": "true-kite-235118",
"numericId": "911077124704",
"projectReference": {
"projectId": "true-kite-235118"
},
"friendlyName": "My First Project"
}
],
"totalItems": 2
}
Table Data¶
listTabledata
The listTabledata operation retrieves table data from a specified set of rows. For more information, see related BigQuery documentation.
Parameter Name | Description | Required |
---|---|---|
datasetId | The maximum number of results per page. | Yes. |
projectId | The ID of the project to which the dataset belongs. | Yes. |
tableId | The ID of the table. | Yes. |
maxResults | The maximum results per page. | Yes. |
pageToken | The page token value. | Yes. |
startIndex | Zero-based index of the starting row. | Yes. |
Sample configurations
<bigquery.listTabledata>
<datasetId>{$ctx:datasetId}</datasetId>
<projectId>{$ctx:projectId}</projectId>
<tableId>{$ctx:tableId}</tableId>
<maxResults>{$ctx:maxResults}</maxResults>
<pageToken>{$ctx:pageToken}</pageToken>
<startIndex>{$ctx:startIndex}</startIndex>
</bigquery.listTabledata>
Sample request
{
"accessToken": "ya29.BwKYx40Dith1DFQBDjZOHNqhcxmKs9zbkjAWQa1q8mdMFndp2-q8ifG66fwprOigRwKSNw",
"apiUrl": "https://www.googleapis.com",
"clientId": "504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com",
"clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM",
"refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
"registryPath": "connectors/bq",
"projectId": "publicdata",
"datasetId": "samples",
"tableId": "github_nested",
"maxResults": "1",
"pageToken": "1",
"startIndex": "1",
"fields": "id",
"callback": "callBackFunction",
"apiKey": "154987fd5h4x6gh4",
"prettyPrint": "true",
"quotaUser": "1hx46f5g4h5ghx6h41x54gh6f4hx",
"userIp": "192.77.88.12",
"ifNoneMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8",
"ifMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8"
}
Sample response
{
"kind": "bigquery#tableDataList",
"etag": "RRRjVfSIc2CcCrEaLPH6Dg==",
"totalRows": "2",
"rows": [
{
"f": [
{
"v": "John"
},
{
"v": null
}
]
},
{
"f": [
{
"v": "Harry"
},
{
"v": "90"
}
]
}
]
}
insertAllTableData
The insertAllTableData operation retrieves table data from a specified set of rows. For more information, see related BigQuery documentation.
Parameter Name | Description | Required |
---|---|---|
datasetId | The maximum number of results per page. | Yes. |
projectId | The ID of the project to which the dataset belongs. | Yes. |
tableId | The ID of the table. | Yes. |
skipInvalidRows | A boolean value to check whether the row should be validated. | Yes. |
ignoreUnknownValues | A boolean value to validate whether the values match the table schema. | Yes. |
templateSuffix | Instance table. | Yes. |
jsonPay | A JSON object that contains a row of data. | Yes. |
Sample configurations
<bigquery.insertAllTableData>
<datasetId>{$ctx:datasetId}</datasetId>
<projectId>{$ctx:projectId}</projectId>
<tableId>{$ctx:tableId}</tableId>
<skipInvalidRows>{$ctx:skipInvalidRows}</skipInvalidRows>
<ignoreUnknownValues>{$ctx:ignoreUnknownValues}</ignoreUnknownValues>
<templateSuffix>{$ctx:templateSuffix}</templateSuffix>
<jsonPay>{$ctx:jsonPay}</jsonPay>
</bigquery.insertAllTableData>
Sample request
{
"apiUrl":"https://www.googleapis.com",
"keyStoreLocation":"/home/hariprasath/Desktop/bigQuery/p12/Non Production-232c0d8ac8f2.p12",
"serviceAccount":"service-account.gserviceaccount.com",
"scope":"https://www.googleapis.com/auth/bigquery",
"datasetId": "zSta",
"tableId": "ECOMM",
"projectId": "dataservices",
"kind": "bigquery#tableDataInsertAllRequest",
"skipInvalidRows": true,
"ignoreUnknownValues": true,
"templateSuffix":"_20160315",
"jsonPay":
{
"insertId": "xxxxx",
"json":
{
"SOURCE_ID":"2",
"DESTINATION_ID":"13",
"SIGNAL_TYPE_ID":"13",
"DATA":"hariprasath",
"TRANSACTION_TIMESTAMP":"2014-03-01T22:12:22.000Z",
"BQ_INSERT_TIMESTAMP":"2016-02-26 20:12:01"
}
}
}
Following is a sample request that inserts multiple records.
{
"apiUrl":"https://www.googleapis.com",
"keyStoreLocation":"/home/hariprasath/Desktop/bigQuery/p12/Non Production-232c0d8ac8f2.p12",
"serviceAccount":"service-account.gserviceaccount.com",
"scope":"https://www.googleapis.com/auth/bigquery",
"datasetId": "zSta",
"tableId": "Sample",
"projectId": "dataservices",
"kind": "bigquery#tableDataInsertAllRequest",
"skipInvalidRows": true,
"ignoreUnknownValues": true,
"templateSuffix":"_20160315",
"jsonPay":[
{
"insertId":"1014",
"json":{
"Name":"John",
"Age":25
}
},
{
"insertId":"1015",
"json":{
"Name":"Vasan",
"Age":45
}
}
]
}
Sample response
{
"kind": "bigquery#tableDataInsertAllResponse"
}
Tables¶
getTable
The getTable operation retrieves a table by ID. For more information, see related BigQuery documentation.
Parameter Name | Description | Required |
---|---|---|
tableId | The ID of the table. | Yes. |
datasetId | The dataset ID of the requested table. | Yes. |
projectId | The project ID of the requested table. | Yes. |
Sample configurations
<bigquery.getTable>
<tableId>{$ctx:tableId}</tableId>
<datasetId>{$ctx:datasetId}</datasetId>
<projectId>{$ctx:projectId}</projectId>
</bigquery.getTable>
Sample request
{
"accessToken": "ya29.BwKYx40Dith1DFQBDjZOHNqhcxmKs9zbkjAWQa1q8mdMFndp2-q8ifG66fwprOigRwKSNw",
"apiUrl": "https://www.googleapis.com",
"clientId": "504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com",
"clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM",
"refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
"registryPath": "connectors/bq",
"projectId": "publicdata",
"datasetId": "samples",
"tableId": "github_nested",
"maxResults": "1",
"pageToken": "1",
"startIndex": "1",
"fields": "id",
"callback": "callBackFunction",
"apiKey": "154987fd5h4x6gh4",
"prettyPrint": "true",
"quotaUser": "1hx46f5g4h5ghx6h41x54gh6f4hx",
"userIp": "192.77.88.12",
"ifNoneMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8",
"ifMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8"
}
Sample response
{
"kind": "bigquery#tableList",
"etag": "ASMRI9cY0t0ilhpaFI4OMA==",
"tables": [
{
"kind": "bigquery#table",
"id": "testbig-235116:testData.github_nested_copy",
"tableReference": {
"projectId": "testbig-235116",
"datasetId": "testData",
"tableId": "github_nested_copy"
},
"type": "TABLE",
"creationTime": "1553104818977",
"expirationTime": "1558288818977"
},
{
"kind": "bigquery#table",
"id": "testbig-235116:testData.sample_20190322",
"tableReference": {
"projectId": "testbig-235116",
"datasetId": "testData",
"tableId": "sample_20190322"
},
"type": "TABLE",
"creationTime": "1553239767833",
"expirationTime": "1558423767833"
}
],
"totalItems": 2
}
listTables
The listTables operation retrieves all available tables in the specified dataset. For more information, see related BigQuery documentation.
Parameter Name | Description | Required |
---|---|---|
datasetId | The dataset ID of the tables that should be listed. | Yes. |
pageToken | The page token (which is returned by a previous call) for requesting the next page of results. | Yes. |
projectId | The project ID of the tables that should be listed. | Yes. |
maxResults | The maximum number of results to return. | Yes. |
Sample configurations
<bigquery.listTables>
<datasetId>{$ctx:datasetId}</datasetId>
<pageToken>{$ctx:pageToken}</pageToken>
<projectId>{$ctx:projectId}</projectId>
<maxResults>{$ctx:maxResults}</maxResults>
</bigquery.listTables>
Sample request
{
"accessToken": "ya29.BwKYx40Dith1DFQBDjZOHNqhcxmKs9zbkjAWQa1q8mdMFndp2-q8ifG66fwprOigRwKSNw",
"apiUrl": "https://www.googleapis.com",
"clientId": "504627865627-kdni8r2s10sjddfgXzqb4bvnba.apps.googleusercontent.com",
"clientSecret": "ChlbHI_T7zssXXTRYuqj_-TM",
"refreshToken": "1/uWful-diQNAdk-alDUa6ixxxxxxxx-LpJIikEQ2sqA",
"registryPath": "connectors/bq",
"projectId": "publicdata",
"datasetId": "samples",
"tableId": "github_nested",
"maxResults": "1",
"pageToken": "1",
"startIndex": "1",
"fields": "id",
"callback": "callBackFunction",
"apiKey": "154987fd5h4x6gh4",
"prettyPrint": "true",
"quotaUser": "1hx46f5g4h5ghx6h41x54gh6f4hx",
"userIp": "192.77.88.12",
"ifNoneMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8",
"ifMatch":"hnk59tKBkX8cdlePZ8VtzgVzuO4/tS1oqpXxnkU21hZeK5k4lqRrRr8"
}
Sample response
{
"kind": "bigquery#tableList",
"etag": "ASMRI9cY0t0ilhpaFI4OMA==",
"tables": [
{
"kind": "bigquery#table",
"id": "testbig-235116:testData.github_nested_copy",
"tableReference": {
"projectId": "testbig-235116",
"datasetId": "testData",
"tableId": "github_nested_copy"
},
"type": "TABLE",
"creationTime": "1553104818977",
"expirationTime": "1558288818977"
},
{
"kind": "bigquery#table",
"id": "testbig-235116:testData.sample_20190322",
"tableReference": {
"projectId": "testbig-235116",
"datasetId": "testData",
"tableId": "sample_20190322"
},
"type": "TABLE",
"creationTime": "1553239767833",
"expirationTime": "1558423767833"
}
],
"totalItems": 2
}