Class BigQueryConfig
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
BigQueryConfig
Đối tượng cấu hình cho trình kết nối BigQuery gốc. Trả về đối tượng này từ getData()
để Data Studio truy vấn BigQuery cho trình kết nối.
const cc = DataStudioApp.createCommunityConnector();
const bqConfig =
cc.newBigQueryConfig()
.setBillingProjectId('billingProjectId')
.setQuery('queryString')
.setUseStandardSql(true)
.setAccessToken('accessToken')
.addQueryParameter('dob', cc.BigQueryParameterType.STRING, '01011990')
.build();
Tài liệu chi tiết
addQueryParameter(name, type, value)
build()
Xác thực đối tượng này và trả về đối tượng đó ở định dạng mà Data Studio cần.
Cầu thủ trả bóng
Object
– Đối tượng Config
đã được xác thực.
printJson()
In nội dung đại diện JSON của đối tượng này. Lựa chọn này chỉ dùng để gỡ lỗi.
Cầu thủ trả bóng
String
setAccessToken(accessToken)
Đặt mã truy cập của BigQueryConfig
này.
Tham số
Tên | Loại | Mô tả |
accessToken | String | Mã truy cập cần đặt. |
Cầu thủ trả bóng
BigQueryConfig
– Đối tượng này, để tạo chuỗi.
setBillingProjectId(billingProjectId)
Đặt mã dự án thanh toán của BigQueryConfig
này.
Tham số
Tên | Loại | Mô tả |
billingProjectId | String | Mã dự án thanh toán cần đặt. |
Cầu thủ trả bóng
BigQueryConfig
– Đối tượng này, để tạo chuỗi.
setQuery(query)
Đặt truy vấn SQL của BigQueryConfig
này.
Tham số
Tên | Loại | Mô tả |
query | String | Truy vấn cần đặt. |
Cầu thủ trả bóng
BigQueryConfig
– Đối tượng này, để tạo chuỗi.
setUseStandardSql(useStandardSql)
Xác định xem truy vấn được diễn giải là SQL chuẩn hay SQL cũ.
Tham số
Tên | Loại | Mô tả |
useStandardSql | Boolean | Nếu là true , truy vấn sẽ được diễn giải là SQL chuẩn. Nếu là false , truy vấn sẽ được diễn giải là SQL cũ. |
Cầu thủ trả bóng
BigQueryConfig
– Đối tượng này, để tạo chuỗi.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eBigQueryConfig\u003c/code\u003e enables Data Studio connectors to query BigQuery using specified configurations.\u003c/p\u003e\n"],["\u003cp\u003eIt allows setting the billing project, query, SQL type (standard or legacy), and access token.\u003c/p\u003e\n"],["\u003cp\u003eQuery parameters can be added using \u003ccode\u003eaddQueryParameter\u003c/code\u003e with their name, type, and value.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ebuild()\u003c/code\u003e validates the configuration and returns a \u003ccode\u003eConfig\u003c/code\u003e object for Data Studio to use.\u003c/p\u003e\n"],["\u003cp\u003eFor debugging, \u003ccode\u003eprintJson()\u003c/code\u003e provides the JSON representation of the configuration.\u003c/p\u003e\n"]]],[],null,["# Class BigQueryConfig\n\nBigQueryConfig\n\nA configuration object for a native BigQuery connector. Return this object from `get``Data()`\nfor Data Studio to query BigQuery for the connector.\n\n```javascript\nconst cc = DataStudioApp.createCommunityConnector();\n\nconst bqConfig =\n cc.newBigQueryConfig()\n .setBillingProjectId('billingProjectId')\n .setQuery('queryString')\n .setUseStandardSql(true)\n .setAccessToken('accessToken')\n .addQueryParameter('dob', cc.BigQueryParameterType.STRING, '01011990')\n .build();\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------------------------------------------------------|---------------------|---------------------------------------------------------------------------|\n| [addQueryParameter(name, type, value)](#addQueryParameter(String,BigQueryParameterType,String)) | [BigQueryConfig](#) | Adds a query parameter to this [BigQueryConfig](#). |\n| [build()](#build()) | `Object` | Validates this object and returns it in the format needed by Data Studio. |\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n| [setAccessToken(accessToken)](#setAccessToken(String)) | [BigQueryConfig](#) | Sets the access token of this [BigQueryConfig](#). |\n| [setBillingProjectId(billingProjectId)](#setBillingProjectId(String)) | [BigQueryConfig](#) | Sets the billing project ID of this [BigQueryConfig](#). |\n| [setQuery(query)](#setQuery(String)) | [BigQueryConfig](#) | Sets the SQL query of this [BigQueryConfig](#). |\n| [setUseStandardSql(useStandardSql)](#setUseStandardSql(Boolean)) | [BigQueryConfig](#) | Determines if the query is interpreted as standard or legacy SQL. |\n\nDetailed documentation\n----------------------\n\n### `add``Query``Parameter(name, type, value)`\n\nAdds a query parameter to this [BigQueryConfig](#).\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|--------------------------------------------------------------------------------------|----------------------|\n| `name` | `String` | The parameter name. |\n| `type` | [BigQueryParameterType](/apps-script/reference/data-studio/big-query-parameter-type) | The parameter type. |\n| `value` | `String` | The parameter value. |\n\n#### Return\n\n\n[BigQueryConfig](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `build()`\n\nValidates this object and returns it in the format needed by Data Studio.\n\n#### Return\n\n\n`Object` --- The validated [Config](/apps-script/reference/data-studio/config) object.\n\n*** ** * ** ***\n\n### `print``Json()`\n\nPrints the JSON representation of this object. This is for debugging only.\n\n#### Return\n\n\n`String`\n\n*** ** * ** ***\n\n### `set``Access``Token(accessToken)`\n\nSets the access token of this [BigQueryConfig](#).\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------------|----------|--------------------------|\n| `access``Token` | `String` | The access token to set. |\n\n#### Return\n\n\n[BigQueryConfig](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Billing``Project``Id(billingProjectId)`\n\nSets the billing project ID of this [BigQueryConfig](#).\n\n#### Parameters\n\n| Name | Type | Description |\n|------------------------|----------|--------------------------------|\n| `billing``Project``Id` | `String` | The billing project ID to set. |\n\n#### Return\n\n\n[BigQueryConfig](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Query(query)`\n\nSets the SQL query of this [BigQueryConfig](#).\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|----------|-------------------|\n| `query` | `String` | The query to set. |\n\n#### Return\n\n\n[BigQueryConfig](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Use``Standard``Sql(useStandardSql)`\n\nDetermines if the query is interpreted as standard or legacy SQL.\n\n#### Parameters\n\n| Name | Type | Description |\n|----------------------|-----------|----------------------------------------------------------------------------------------------------------|\n| `use``Standard``Sql` | `Boolean` | If `true`, the query is interpreted as standard SQL. If `false`, the query is interpreted as legacy SQL. |\n\n#### Return\n\n\n[BigQueryConfig](#) --- This object, for chaining."]]