Class BigQueryDataSourceSpec
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
مستندات تفصيلية
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.
الإرجاع
String
: معرّف مجموعة البيانات، أو سلسلة فارغة إذا تم تحديد مواصفات مصدر البيانات من خلال طلب بحث أولي.
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()
للحصول على رقم تعريف مشروع الفوترة
الإرجاع
String
- رقم تعريف المشروع
getRawQuery()
تحصل على سلسلة طلب البحث الأوّلية.
الإرجاع
String
: سلسلة طلب البحث الأوّلية
getTableId()
تحصل على معرّف جدول BigQuery.
الإرجاع
String
: رقم تعريف الجدول، أو سلسلة فارغة إذا تم تحديد مواصفات مصدر البيانات من خلال طلب بحث أولي.
getTableProjectId()
تحصل على رقم تعريف مشروع BigQuery للجدول.
الإرجاع
String
: رقم تعريف مشروع الجدول، أو سلسلة فارغة إذا تم تحديد مواصفات مصدر البيانات من خلال طلب بحث خام.
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
: نوع مصدر البيانات
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003eBigQueryDataSourceSpec\u003c/code\u003e allows access to existing BigQuery data source specifications within a spreadsheet.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a new data source specification using \u003ccode\u003eSpreadsheetApp.newDataSourceSpec()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides methods to get various details about the data source, such as dataset ID, project ID, raw query, parameters, and table information.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecopy()\u003c/code\u003e method enables the creation of a \u003ccode\u003eDataSourceSpecBuilder\u003c/code\u003e to modify existing specifications.\u003c/p\u003e\n"],["\u003cp\u003eUtilize methods like \u003ccode\u003egetDatasetId()\u003c/code\u003e, \u003ccode\u003egetRawQuery()\u003c/code\u003e, \u003ccode\u003egetTableId()\u003c/code\u003e, and others to retrieve specific attributes of the BigQuery data source.\u003c/p\u003e\n"]]],[],null,["# Class BigQueryDataSourceSpec\n\nBigQueryDataSourceSpec\n\nAccess the existing BigQuery data source specification. To create a new data source\nspecification, use [SpreadsheetApp.newDataSourceSpec()](/apps-script/reference/spreadsheet/spreadsheet-app#newDataSourceSpec()). \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| [copy()](#copy()) | [DataSourceSpecBuilder](/apps-script/reference/spreadsheet/data-source-spec-builder) | Creates a [DataSourceSpecBuilder](/apps-script/reference/spreadsheet/data-source-spec-builder) based on this data source's settings. |\n| [getDatasetId()](#getDatasetId()) | `String` | Gets the BigQuery dataset ID. |\n| [getParameters()](#getParameters()) | [DataSourceParameter[]](/apps-script/reference/spreadsheet/data-source-parameter) | Gets the parameters of the data source. |\n| [getProjectId()](#getProjectId()) | `String` | Gets the billing project ID. |\n| [getRawQuery()](#getRawQuery()) | `String` | Gets the raw query string. |\n| [getTableId()](#getTableId()) | `String` | Gets the BigQuery table ID. |\n| [getTableProjectId()](#getTableProjectId()) | `String` | Gets the BigQuery project ID for the table. |\n| [getType()](#getType()) | [DataSourceType](/apps-script/reference/spreadsheet/data-source-type) | Gets the type of the data source. |\n\nDetailed documentation\n----------------------\n\n### `copy()`\n\nCreates a [DataSourceSpecBuilder](/apps-script/reference/spreadsheet/data-source-spec-builder) based on this data source's settings.\n\n```javascript\n// TODO(developer): Replace the URL with your own.\nconst ss = SpreadsheetApp.openByUrl(\n 'https://docs.google.com/spreadsheets/d/abc123456/edit',\n);\nconst spec = ss.getDataSources()[0].getSpec();\n\nconst newSpec = spec.copy();\n```\n\n#### Return\n\n\n[DataSourceSpecBuilder](/apps-script/reference/spreadsheet/data-source-spec-builder) --- The builder.\n\n*** ** * ** ***\n\n### `get``Dataset``Id()`\n\nGets the BigQuery dataset ID.\n\n#### Return\n\n\n`String` --- The dataset ID, or an empty string if the data source spec is defined by a raw query.\n\n*** ** * ** ***\n\n### `get``Parameters()`\n\nGets the parameters of the data source.\n\n```javascript\n// TODO(developer): Replace the URL with your own.\nconst ss = SpreadsheetApp.openByUrl(\n 'https://docs.google.com/spreadsheets/d/abc123456/edit',\n);\nconst spec = ss.getDataSources()[0].getSpec();\nconst parameters = spec.getParameters();\n```\n\nThis method is only available for BigQuery data sources.\n\n#### Return\n\n\n[DataSourceParameter[]](/apps-script/reference/spreadsheet/data-source-parameter) --- The parameter list.\n\n*** ** * ** ***\n\n### `get``Project``Id()`\n\nGets the billing project ID.\n\n#### Return\n\n\n`String` --- The project ID.\n\n*** ** * ** ***\n\n### `get``Raw``Query()`\n\nGets the raw query string.\n\n#### Return\n\n\n`String` --- The raw query string.\n\n*** ** * ** ***\n\n### `get``Table``Id()`\n\nGets the BigQuery table ID.\n\n#### Return\n\n\n`String` --- The table ID, or an empty string if the data source spec is defined by a raw query.\n\n*** ** * ** ***\n\n### `get``Table``Project``Id()`\n\nGets the BigQuery project ID for the table.\n\n#### Return\n\n\n`String` --- The table project ID, or an empty string if the data source spec is defined by a raw\nquery.\n\n*** ** * ** ***\n\n### `get``Type()`\n\nGets the type of the data source.\n\n```javascript\n// TODO(developer): Replace the URL with your own.\nconst ss = SpreadsheetApp.openByUrl(\n 'https://docs.google.com/spreadsheets/d/abc123456/edit',\n);\nconst spec = ss.getDataSources()[0].getSpec();\nconst type = spec.getType();\n```\n\n#### Return\n\n\n[DataSourceType](/apps-script/reference/spreadsheet/data-source-type) --- The data source type."]]