Optional. When true and use_topic_schema is true, any fields that are a
part of the topic schema that are not part of the BigQuery table schema are
dropped when writing to BigQuery. Otherwise, the schemas must be kept in
sync and any messages with extra fields are not written and remain in the
subscription's backlog.
Optional. The service account to use to write to BigQuery. The subscription
creator or updater that specifies this field must have
iam.serviceAccounts.actAs permission on the service account. If not
specified, the Pub/Sub service
agent,
service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
Optional. When true, use the BigQuery table's schema as the columns to
write to in BigQuery. use_table_schema and use_topic_schema cannot be
enabled at the same time.
Optional. When true, use the topic's schema as the columns to write to in
BigQuery, if it exists. use_topic_schema and use_table_schema cannot be
enabled at the same time.
Optional. When true, write the subscription name, message_id, publish_time,
attributes, and ordering_key to additional columns in the table. The
subscription name, message_id, and publish_time fields are put in their own
columns while all other message properties (other than data) are written to
a JSON object in the attributes column.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eBigQueryConfig\u003c/code\u003e class in the Google Cloud Pub/Sub v1 API is used for configuring a BigQuery subscription, allowing you to specify how Pub/Sub messages are written to a BigQuery table.\u003c/p\u003e\n"],["\u003cp\u003eThis class supports multiple versions, with the latest being 3.23.0, and includes various older versions going back to 2.3.0.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of \u003ccode\u003eBigQueryConfig\u003c/code\u003e include options to specify the target table, service account email, and whether to use the table or topic schema, or metadata.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBigQueryConfig\u003c/code\u003e can utilize features such as \u003ccode\u003eDropUnknownFields\u003c/code\u003e, allowing for the omission of fields in the topic schema that aren't present in the BigQuery table schema.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eBigQueryConfig\u003c/code\u003e has an output only \u003ccode\u003eState\u003c/code\u003e property that indicates whether or not a subscription can receive messages.\u003c/p\u003e\n"]]],[],null,["# Cloud Pub/Sub v1 API - Class BigQueryConfig (3.27.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.0 (latest)](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.26.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.26.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.25.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.25.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.24.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.24.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.23.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.23.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.22.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.22.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.21.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.21.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.20.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.20.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.19.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.19.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.18.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.18.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.17.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.17.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.16.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.16.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.15.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.15.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.14.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.13.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.12.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.11.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.10.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.10.1/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.9.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.9.1/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.8.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.7.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.6.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.5.1/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.4.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.3.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.2.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.1.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.0.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.10.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.9.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.8.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.7.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.6.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.5.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.4.0/Google.Cloud.PubSub.V1.BigQueryConfig)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.3.0/Google.Cloud.PubSub.V1.BigQueryConfig) \n\n public sealed class BigQueryConfig : IMessage\u003cBigQueryConfig\u003e, IEquatable\u003cBigQueryConfig\u003e, IDeepCloneable\u003cBigQueryConfig\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Pub/Sub v1 API class BigQueryConfig.\n\nConfiguration for a BigQuery subscription. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BigQueryConfig \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[BigQueryConfig](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.BigQueryConfig), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[BigQueryConfig](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.BigQueryConfig), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[BigQueryConfig](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.BigQueryConfig), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.PubSub.V1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.PubSub.V1.dll\n\nConstructors\n------------\n\n### BigQueryConfig()\n\n public BigQueryConfig()\n\n### BigQueryConfig(BigQueryConfig)\n\n public BigQueryConfig(BigQueryConfig other)\n\nProperties\n----------\n\n### DropUnknownFields\n\n public bool DropUnknownFields { get; set; }\n\nOptional. When true and use_topic_schema is true, any fields that are a\npart of the topic schema that are not part of the BigQuery table schema are\ndropped when writing to BigQuery. Otherwise, the schemas must be kept in\nsync and any messages with extra fields are not written and remain in the\nsubscription's backlog.\n\n### ServiceAccountEmail\n\n public string ServiceAccountEmail { get; set; }\n\nOptional. The service account to use to write to BigQuery. The subscription\ncreator or updater that specifies this field must have\n`iam.serviceAccounts.actAs` permission on the service account. If not\nspecified, the Pub/Sub [service\nagent](https://cloud.google.com/iam/docs/service-agents),\nservice-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.\n\n### State\n\n public BigQueryConfig.Types.State State { get; set; }\n\nOutput only. An output-only field that indicates whether or not the\nsubscription can receive messages.\n\n### Table\n\n public string Table { get; set; }\n\nOptional. The name of the table to which to write data, of the form\n{projectId}.{datasetId}.{tableId}\n\n### UseTableSchema\n\n public bool UseTableSchema { get; set; }\n\nOptional. When true, use the BigQuery table's schema as the columns to\nwrite to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be\nenabled at the same time.\n\n### UseTopicSchema\n\n public bool UseTopicSchema { get; set; }\n\nOptional. When true, use the topic's schema as the columns to write to in\nBigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be\nenabled at the same time.\n\n### WriteMetadata\n\n public bool WriteMetadata { get; set; }\n\nOptional. When true, write the subscription name, message_id, publish_time,\nattributes, and ordering_key to additional columns in the table. The\nsubscription name, message_id, and publish_time fields are put in their own\ncolumns while all other message properties (other than data) are written to\na JSON object in the attributes column."]]