既存の BigQuery データソース仕様にアクセスします。新しいデータソース仕様を作成するには、SpreadsheetApp.newDataSourceSpec() を使用します。
メソッド
| メソッド | 戻り値の型 | 概要 |
|---|---|---|
copy() | Data | このデータソースの設定に基づいて Data を作成します。 |
get | String | BigQuery データセット ID を取得します。 |
get | Data | データソースのパラメータを取得します。 |
get | String | 課金プロジェクト ID を取得します。 |
get | String | 生のクエリ文字列を取得します。 |
get | String | BigQuery テーブル ID を取得します。 |
get | String | テーブルの BigQuery プロジェクト ID を取得します。 |
get | Data | データソースのタイプを取得します。 |
詳細なドキュメント
copy()
このデータソースの設定に基づいて DataSourceSpecBuilder を作成します。
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const newSpec = spec.copy();
戻る
DataSourceSpecBuilder - ビルダー。
getDatasetId()
BigQuery データセット ID を取得します。
戻る
String - データセット ID。データソース仕様が生のクエリで定義されている場合は空の文字列。
getParameters()
データソースのパラメータを取得します。
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const parameters = spec.getParameters();
このメソッドは、BigQuery データソースでのみ使用できます。
戻る
DataSourceParameter[] - パラメータ リスト。
getProjectId()
課金プロジェクト ID を取得します。
戻る
String - プロジェクト ID。
getRawQuery()
生のクエリ文字列を取得します。
戻る
String - 生のクエリ文字列。
getTableId()
BigQuery テーブル ID を取得します。
戻る
String - テーブル ID。データソース仕様が生のクエリで定義されている場合は空の文字列。
getTableProjectId()
テーブルの BigQuery プロジェクト ID を取得します。
戻る
String - テーブル プロジェクト ID。データソース仕様が生の
クエリで定義されている場合は空の文字列。
getType()
データソースのタイプを取得します。
// TODO(developer): Replace the URL with your own. const ss = SpreadsheetApp.openByUrl( 'https://docs.google.com/spreadsheets/d/abc123456/edit', ); const spec = ss.getDataSources()[0].getSpec(); const type = spec.getType();
戻る
DataSourceType - データソースのタイプ。