Class BigQueryDataSourceSpec

  • BigQueryDataSourceSpec allows access to existing BigQuery data source specifications within SpreadsheetApp.

  • You can create a new data source specification using SpreadsheetApp.newDataSourceSpec().

  • The methods available include retrieving dataset ID, parameters, project ID, raw query, table ID, table project ID, and data source type.

  • The copy() method creates a DataSourceSpecBuilder based on the existing data source's settings.

BigQueryDataSourceSpec

Access the existing BigQuery data source specification. To create a new data source specification, use SpreadsheetApp.newDataSourceSpec() .

Methods

MethodReturn typeBrief description
copy() DataSourceSpecBuilder Creates a DataSourceSpecBuilder based on this data source's settings.
getDatasetId() StringGets the BigQuery dataset ID.
getParameters() DataSourceParameter[] Gets the parameters of the data source.
getProjectId() StringGets the billing project ID.
getRawQuery() StringGets the raw query string.
getTableId() StringGets the BigQuery table ID.
getTableProjectId() StringGets the BigQuery project ID for the table.
getType() DataSourceType Gets the type of the data source.

Detailed documentation

copy()

Creates a DataSourceSpecBuilder based on this data source's settings.

// TODO(developer): Replace the URL with your own.
constss=SpreadsheetApp.openByUrl(
'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
constspec=ss.getDataSources()[0].getSpec();
constnewSpec=spec.copy();

Return

DataSourceSpecBuilder — The builder.


getDatasetId()

Gets the BigQuery dataset ID.

Return

String — The dataset ID, or an empty string if the data source spec is defined by a raw query.


getParameters()

Gets the parameters of the data source.

// TODO(developer): Replace the URL with your own.
constss=SpreadsheetApp.openByUrl(
'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
constspec=ss.getDataSources()[0].getSpec();
constparameters=spec.getParameters();

This method is only available for BigQuery data sources.

Return

DataSourceParameter[] — The parameter list.


getProjectId()

Gets the billing project ID.

Return

String — The project ID.


getRawQuery()

Gets the raw query string.

Return

String — The raw query string.


getTableId()

Gets the BigQuery table ID.

Return

String — The table ID, or an empty string if the data source spec is defined by a raw query.


getTableProjectId()

Gets the BigQuery project ID for the table.

Return

String — The table project ID, or an empty string if the data source spec is defined by a raw query.


getType()

Gets the type of the data source.

// TODO(developer): Replace the URL with your own.
constss=SpreadsheetApp.openByUrl(
'https://docs.google.com/spreadsheets/d/abc123456/edit',
);
constspec=ss.getDataSources()[0].getSpec();
consttype=spec.getType();

Return

DataSourceType — The data source type.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年12月02日 UTC.