Skip to content

Commit

Permalink
feat(bigquery): update the api
Browse files Browse the repository at this point in the history
#### bigquery:v2

The following keys were added:
- resources.tables.methods.get.parameters.view (Total Keys: 2)
- schemas.IndexUnusedReason (Total Keys: 9)
- schemas.JobStatistics2.properties.searchStatistics.$ref (Total Keys: 1)
- schemas.SearchStatistics (Total Keys: 5)
  • Loading branch information
yoshi-automation committed Jun 7, 2022
1 parent cd0db01 commit 5f9ef85
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 3 deletions.
75 changes: 75 additions & 0 deletions docs/dyn/bigquery_v2.jobs.html
Expand Up @@ -642,6 +642,21 @@ <h3>Method Details</h3>
},
],
},
&quot;searchStatistics&quot;: { # [Output-only] Search query specific statistics.
&quot;indexUnusedReason&quot;: [ # When index_usage_mode is UNUSED or PARTIALLY_USED, this field explains why index was not used in all or part of the search query. If index_usage_mode is FULLLY_USED, this field is not populated.
{
&quot;base_table&quot;: { # [Output-only] Specifies the base table involved in the reason that no search index was used.
&quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
&quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
&quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
},
&quot;code&quot;: &quot;$(reason.code)&quot;, # [Output-only] Specifies the high-level reason for the scenario when no search index was used.
&quot;index_name&quot;: &quot;$(reason.index_name)&quot;, # [Output-only] Specifies the name of the unused search index, if available.
&quot;message&quot;: &quot;$(reason.message)&quot;, # [Output-only] Free form human-readable reason for the scenario when no search index was used.
},
],
&quot;indexUsageMode&quot;: &quot;A String&quot;, # Specifies index usage mode for the query.
},
&quot;statementType&quot;: &quot;A String&quot;, # The type of query statement, if valid. Possible values (new values might be added in the future): &quot;SELECT&quot;: SELECT query. &quot;INSERT&quot;: INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;UPDATE&quot;: UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;DELETE&quot;: DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;MERGE&quot;: MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;ALTER_TABLE&quot;: ALTER TABLE query. &quot;ALTER_VIEW&quot;: ALTER VIEW query. &quot;ASSERT&quot;: ASSERT condition AS &#x27;description&#x27;. &quot;CREATE_FUNCTION&quot;: CREATE FUNCTION query. &quot;CREATE_MODEL&quot;: CREATE [OR REPLACE] MODEL ... AS SELECT ... . &quot;CREATE_PROCEDURE&quot;: CREATE PROCEDURE query. &quot;CREATE_TABLE&quot;: CREATE [OR REPLACE] TABLE without AS SELECT. &quot;CREATE_TABLE_AS_SELECT&quot;: CREATE [OR REPLACE] TABLE ... AS SELECT ... . &quot;CREATE_VIEW&quot;: CREATE [OR REPLACE] VIEW ... AS SELECT ... . &quot;DROP_FUNCTION&quot; : DROP FUNCTION query. &quot;DROP_PROCEDURE&quot;: DROP PROCEDURE query. &quot;DROP_TABLE&quot;: DROP TABLE query. &quot;DROP_VIEW&quot;: DROP VIEW query.
&quot;timeline&quot;: [ # [Output-only] [Beta] Describes a timeline of job execution.
{
Expand Down Expand Up @@ -1294,6 +1309,21 @@ <h3>Method Details</h3>
},
],
},
&quot;searchStatistics&quot;: { # [Output-only] Search query specific statistics.
&quot;indexUnusedReason&quot;: [ # When index_usage_mode is UNUSED or PARTIALLY_USED, this field explains why index was not used in all or part of the search query. If index_usage_mode is FULLLY_USED, this field is not populated.
{
&quot;base_table&quot;: { # [Output-only] Specifies the base table involved in the reason that no search index was used.
&quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
&quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
&quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
},
&quot;code&quot;: &quot;$(reason.code)&quot;, # [Output-only] Specifies the high-level reason for the scenario when no search index was used.
&quot;index_name&quot;: &quot;$(reason.index_name)&quot;, # [Output-only] Specifies the name of the unused search index, if available.
&quot;message&quot;: &quot;$(reason.message)&quot;, # [Output-only] Free form human-readable reason for the scenario when no search index was used.
},
],
&quot;indexUsageMode&quot;: &quot;A String&quot;, # Specifies index usage mode for the query.
},
&quot;statementType&quot;: &quot;A String&quot;, # The type of query statement, if valid. Possible values (new values might be added in the future): &quot;SELECT&quot;: SELECT query. &quot;INSERT&quot;: INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;UPDATE&quot;: UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;DELETE&quot;: DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;MERGE&quot;: MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;ALTER_TABLE&quot;: ALTER TABLE query. &quot;ALTER_VIEW&quot;: ALTER VIEW query. &quot;ASSERT&quot;: ASSERT condition AS &#x27;description&#x27;. &quot;CREATE_FUNCTION&quot;: CREATE FUNCTION query. &quot;CREATE_MODEL&quot;: CREATE [OR REPLACE] MODEL ... AS SELECT ... . &quot;CREATE_PROCEDURE&quot;: CREATE PROCEDURE query. &quot;CREATE_TABLE&quot;: CREATE [OR REPLACE] TABLE without AS SELECT. &quot;CREATE_TABLE_AS_SELECT&quot;: CREATE [OR REPLACE] TABLE ... AS SELECT ... . &quot;CREATE_VIEW&quot;: CREATE [OR REPLACE] VIEW ... AS SELECT ... . &quot;DROP_FUNCTION&quot; : DROP FUNCTION query. &quot;DROP_PROCEDURE&quot;: DROP PROCEDURE query. &quot;DROP_TABLE&quot;: DROP TABLE query. &quot;DROP_VIEW&quot;: DROP VIEW query.
&quot;timeline&quot;: [ # [Output-only] [Beta] Describes a timeline of job execution.
{
Expand Down Expand Up @@ -2017,6 +2047,21 @@ <h3>Method Details</h3>
},
],
},
&quot;searchStatistics&quot;: { # [Output-only] Search query specific statistics.
&quot;indexUnusedReason&quot;: [ # When index_usage_mode is UNUSED or PARTIALLY_USED, this field explains why index was not used in all or part of the search query. If index_usage_mode is FULLLY_USED, this field is not populated.
{
&quot;base_table&quot;: { # [Output-only] Specifies the base table involved in the reason that no search index was used.
&quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
&quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
&quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
},
&quot;code&quot;: &quot;$(reason.code)&quot;, # [Output-only] Specifies the high-level reason for the scenario when no search index was used.
&quot;index_name&quot;: &quot;$(reason.index_name)&quot;, # [Output-only] Specifies the name of the unused search index, if available.
&quot;message&quot;: &quot;$(reason.message)&quot;, # [Output-only] Free form human-readable reason for the scenario when no search index was used.
},
],
&quot;indexUsageMode&quot;: &quot;A String&quot;, # Specifies index usage mode for the query.
},
&quot;statementType&quot;: &quot;A String&quot;, # The type of query statement, if valid. Possible values (new values might be added in the future): &quot;SELECT&quot;: SELECT query. &quot;INSERT&quot;: INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;UPDATE&quot;: UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;DELETE&quot;: DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;MERGE&quot;: MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;ALTER_TABLE&quot;: ALTER TABLE query. &quot;ALTER_VIEW&quot;: ALTER VIEW query. &quot;ASSERT&quot;: ASSERT condition AS &#x27;description&#x27;. &quot;CREATE_FUNCTION&quot;: CREATE FUNCTION query. &quot;CREATE_MODEL&quot;: CREATE [OR REPLACE] MODEL ... AS SELECT ... . &quot;CREATE_PROCEDURE&quot;: CREATE PROCEDURE query. &quot;CREATE_TABLE&quot;: CREATE [OR REPLACE] TABLE without AS SELECT. &quot;CREATE_TABLE_AS_SELECT&quot;: CREATE [OR REPLACE] TABLE ... AS SELECT ... . &quot;CREATE_VIEW&quot;: CREATE [OR REPLACE] VIEW ... AS SELECT ... . &quot;DROP_FUNCTION&quot; : DROP FUNCTION query. &quot;DROP_PROCEDURE&quot;: DROP PROCEDURE query. &quot;DROP_TABLE&quot;: DROP TABLE query. &quot;DROP_VIEW&quot;: DROP VIEW query.
&quot;timeline&quot;: [ # [Output-only] [Beta] Describes a timeline of job execution.
{
Expand Down Expand Up @@ -2644,6 +2689,21 @@ <h3>Method Details</h3>
},
],
},
&quot;searchStatistics&quot;: { # [Output-only] Search query specific statistics.
&quot;indexUnusedReason&quot;: [ # When index_usage_mode is UNUSED or PARTIALLY_USED, this field explains why index was not used in all or part of the search query. If index_usage_mode is FULLLY_USED, this field is not populated.
{
&quot;base_table&quot;: { # [Output-only] Specifies the base table involved in the reason that no search index was used.
&quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
&quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
&quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
},
&quot;code&quot;: &quot;$(reason.code)&quot;, # [Output-only] Specifies the high-level reason for the scenario when no search index was used.
&quot;index_name&quot;: &quot;$(reason.index_name)&quot;, # [Output-only] Specifies the name of the unused search index, if available.
&quot;message&quot;: &quot;$(reason.message)&quot;, # [Output-only] Free form human-readable reason for the scenario when no search index was used.
},
],
&quot;indexUsageMode&quot;: &quot;A String&quot;, # Specifies index usage mode for the query.
},
&quot;statementType&quot;: &quot;A String&quot;, # The type of query statement, if valid. Possible values (new values might be added in the future): &quot;SELECT&quot;: SELECT query. &quot;INSERT&quot;: INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;UPDATE&quot;: UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;DELETE&quot;: DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;MERGE&quot;: MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;ALTER_TABLE&quot;: ALTER TABLE query. &quot;ALTER_VIEW&quot;: ALTER VIEW query. &quot;ASSERT&quot;: ASSERT condition AS &#x27;description&#x27;. &quot;CREATE_FUNCTION&quot;: CREATE FUNCTION query. &quot;CREATE_MODEL&quot;: CREATE [OR REPLACE] MODEL ... AS SELECT ... . &quot;CREATE_PROCEDURE&quot;: CREATE PROCEDURE query. &quot;CREATE_TABLE&quot;: CREATE [OR REPLACE] TABLE without AS SELECT. &quot;CREATE_TABLE_AS_SELECT&quot;: CREATE [OR REPLACE] TABLE ... AS SELECT ... . &quot;CREATE_VIEW&quot;: CREATE [OR REPLACE] VIEW ... AS SELECT ... . &quot;DROP_FUNCTION&quot; : DROP FUNCTION query. &quot;DROP_PROCEDURE&quot;: DROP PROCEDURE query. &quot;DROP_TABLE&quot;: DROP TABLE query. &quot;DROP_VIEW&quot;: DROP VIEW query.
&quot;timeline&quot;: [ # [Output-only] [Beta] Describes a timeline of job execution.
{
Expand Down Expand Up @@ -3299,6 +3359,21 @@ <h3>Method Details</h3>
},
],
},
&quot;searchStatistics&quot;: { # [Output-only] Search query specific statistics.
&quot;indexUnusedReason&quot;: [ # When index_usage_mode is UNUSED or PARTIALLY_USED, this field explains why index was not used in all or part of the search query. If index_usage_mode is FULLLY_USED, this field is not populated.
{
&quot;base_table&quot;: { # [Output-only] Specifies the base table involved in the reason that no search index was used.
&quot;datasetId&quot;: &quot;A String&quot;, # [Required] The ID of the dataset containing this table.
&quot;projectId&quot;: &quot;A String&quot;, # [Required] The ID of the project containing this table.
&quot;tableId&quot;: &quot;A String&quot;, # [Required] The ID of the table. The ID must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 characters.
},
&quot;code&quot;: &quot;$(reason.code)&quot;, # [Output-only] Specifies the high-level reason for the scenario when no search index was used.
&quot;index_name&quot;: &quot;$(reason.index_name)&quot;, # [Output-only] Specifies the name of the unused search index, if available.
&quot;message&quot;: &quot;$(reason.message)&quot;, # [Output-only] Free form human-readable reason for the scenario when no search index was used.
},
],
&quot;indexUsageMode&quot;: &quot;A String&quot;, # Specifies index usage mode for the query.
},
&quot;statementType&quot;: &quot;A String&quot;, # The type of query statement, if valid. Possible values (new values might be added in the future): &quot;SELECT&quot;: SELECT query. &quot;INSERT&quot;: INSERT query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;UPDATE&quot;: UPDATE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;DELETE&quot;: DELETE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;MERGE&quot;: MERGE query; see https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language. &quot;ALTER_TABLE&quot;: ALTER TABLE query. &quot;ALTER_VIEW&quot;: ALTER VIEW query. &quot;ASSERT&quot;: ASSERT condition AS &#x27;description&#x27;. &quot;CREATE_FUNCTION&quot;: CREATE FUNCTION query. &quot;CREATE_MODEL&quot;: CREATE [OR REPLACE] MODEL ... AS SELECT ... . &quot;CREATE_PROCEDURE&quot;: CREATE PROCEDURE query. &quot;CREATE_TABLE&quot;: CREATE [OR REPLACE] TABLE without AS SELECT. &quot;CREATE_TABLE_AS_SELECT&quot;: CREATE [OR REPLACE] TABLE ... AS SELECT ... . &quot;CREATE_VIEW&quot;: CREATE [OR REPLACE] VIEW ... AS SELECT ... . &quot;DROP_FUNCTION&quot; : DROP FUNCTION query. &quot;DROP_PROCEDURE&quot;: DROP PROCEDURE query. &quot;DROP_TABLE&quot;: DROP TABLE query. &quot;DROP_VIEW&quot;: DROP VIEW query.
&quot;timeline&quot;: [ # [Output-only] [Beta] Describes a timeline of job execution.
{
Expand Down
10 changes: 8 additions & 2 deletions docs/dyn/bigquery_v2.tables.html
Expand Up @@ -81,7 +81,7 @@ <h2>Instance Methods</h2>
<code><a href="#delete">delete(projectId, datasetId, tableId)</a></code></p>
<p class="firstline">Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.</p>
<p class="toc_element">
<code><a href="#get">get(projectId, datasetId, tableId, selectedFields=None)</a></code></p>
<code><a href="#get">get(projectId, datasetId, tableId, selectedFields=None, view=None)</a></code></p>
<p class="firstline">Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.</p>
<p class="toc_element">
<code><a href="#getIamPolicy">getIamPolicy(resource, body=None)</a></code></p>
Expand Down Expand Up @@ -125,14 +125,20 @@ <h3>Method Details</h3>
</div>

<div class="method">
<code class="details" id="get">get(projectId, datasetId, tableId, selectedFields=None)</code>
<code class="details" id="get">get(projectId, datasetId, tableId, selectedFields=None, view=None)</code>
<pre>Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.

Args:
projectId: string, Project ID of the requested table (required)
datasetId: string, Dataset ID of the requested table (required)
tableId: string, Table ID of the requested table (required)
selectedFields: string, List of fields to return (comma-separated). If unspecified, all fields are returned
view: string, Specifies the view that determines which table information is returned. By default, basic table information and storage statistics (STORAGE_STATS) are returned.
Allowed values
BASIC - Includes basic table information including schema and partitioning specification. This view does not include storage statistics such as numRows or numBytes. This view is significantly more efficient and should be used to support high query rates.
FULL - Includes all table information, including storage statistics. It returns same information as STORAGE_STATS view, but may contain additional information in the future.
STORAGE_STATS - Includes all information in the BASIC view as well as storage statistics (numBytes, numLongTermBytes, numRows and lastModifiedTime).
TABLE_METADATA_VIEW_UNSPECIFIED - The default value. Default to the STORAGE_STATS view.

Returns:
An object of the form:
Expand Down

0 comments on commit 5f9ef85

Please sign in to comment.