This is effectively a dictionary where each key is the field name (a string)
and the value is the corresponding value for that field.
Supported value types:
System.Boolean
System.Int16
System.UInt16
System.Int32
System.UInt32
System.Int64
System.Float
System.Double
System.String
System.DateTime
System.DateTimeOffset
System.TimeSpan
Google.Cloud.BigQuery.V2.BigQueryNumeric
Google.Cloud.BigQuery.V2.BigQueryGeography
A Google.Cloud.BigQuery.V2.InsertRow (for record/struct fields)
Any IReadOnlyList<T> of one of the above types (for repeated fields). This
includes arrays and List<T> values.
Note that all integer types are stored as System.Int64, and all floating point
types are stored as System.Double.
DateTimeOffset values are converted to UTC and treated as timestamp. The handling
of DateTime values depends on the Kind: values with a Kind of Local are rejected;
values with a Kind of UTC are treated as timestamps; values with a Kind of Unspecified
are treated as civil datetime values. All values are stored with a precision of a microsecond.
TimeSpan values must be non-negative and less than 24 hours, used to represent a time-of-day.
Although date values are retrieved as System.DateTime, they must be inserted as string values, in the format
"yyyy-MM-dd".
BigQueryInsertRow is used for record/struct fields for convenience, but only the InsertId
of the top-level row is relevant.
Null elements within repeated fields are prohibited. This is validated client-side when the row is inserted; validating
when a value is added to the row would be ineffective as the values could change before insertion.
Constructors
BigQueryInsertRow()
public BigQueryInsertRow()
Constructs an empty row with no insert ID.
BigQueryInsertRow(string)
public BigQueryInsertRow(string insertId)
Constructs an empty row with the specified insert ID.
To help ensure data consistency, you can supply an InsertId for each inserted row.
BigQuery remembers this ID for at least one minute. If you try to stream the same set of rows within
that time period and the insertId property is set, BigQuery uses the property to de-duplicate
your data on a best effort basis. By default if no ID is specified, one will be generated to allow
de-duplicating efforts if insert operations need to be retried.
You can allow empty InsertId by setting AllowEmptyInsertIds to true.
This will allow for faster row inserts at the expense of possible record duplication if the operation needs to be retried.
See https://cloud.google.com/bigquery/quotas#streaming_inserts for more information.
This being named Add rather than AddRange allows
it to be specified in a collection initializer, which can be useful
to provide a set of common fields and then some extra values.
[[["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-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eBigQueryInsertRow\u003c/code\u003e class is used for streaming data insertion into Google BigQuery, serving as a dictionary where keys are field names and values are their corresponding data.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available for the \u003ccode\u003eBigQueryInsertRow\u003c/code\u003e class is 3.11.0, with numerous previous versions from 3.10.0 down to 2.2.0 accessible for reference.\u003c/p\u003e\n"],["\u003cp\u003eSupported value types within \u003ccode\u003eBigQueryInsertRow\u003c/code\u003e include various primitive types like \u003ccode\u003eSystem.Boolean\u003c/code\u003e, \u003ccode\u003eSystem.Int64\u003c/code\u003e, \u003ccode\u003eSystem.Double\u003c/code\u003e, \u003ccode\u003eSystem.String\u003c/code\u003e, and \u003ccode\u003eSystem.DateTime\u003c/code\u003e, along with specialized types like \u003ccode\u003eBigQueryNumeric\u003c/code\u003e and \u003ccode\u003eBigQueryGeography\u003c/code\u003e, or a \u003ccode\u003eInsertRow\u003c/code\u003e for record/struct fields.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003eBigQueryInsertRow\u003c/code\u003e can be assigned an \u003ccode\u003eInsertId\u003c/code\u003e for deduplication purposes, ensuring data consistency when streaming rows within at least one minute, and by default, if no ID is provided, one will be generated to allow for deduplication.\u003c/p\u003e\n"],["\u003cp\u003eYou can add single fields or multiple fields with the Add method to the BigQueryInsertRow class, adding a key and value pair, or an entire dictionary.\u003c/p\u003e\n"]]],[],null,["# Google BigQuery v2 API - Class BigQueryInsertRow (3.11.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.11.0 (latest)](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.10.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.9.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.8.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.7.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.6.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.5.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.4.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.3.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.2.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.1.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/3.0.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.4.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.3.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/2.2.0/Google.Cloud.BigQuery.V2.BigQueryInsertRow) \n\n public sealed class BigQueryInsertRow : IEnumerable\n\nReference documentation and code samples for the Google BigQuery v2 API class BigQueryInsertRow.\n\nA row used for streaming data insertion. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e BigQueryInsertRow \n\nImplements\n----------\n\n[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable) \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.BigQuery.V2](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.BigQuery.V2.dll\n\nRemarks\n-------\n\n\nThis is effectively a dictionary where each key is the field name (a string)\nand the value is the corresponding value for that field.\nSupported value types:\n\n- `System.Boolean`\n- `System.Int16`\n- `System.UInt16`\n- `System.Int32`\n- `System.UInt32`\n- `System.Int64`\n- `System.Float`\n- `System.Double`\n- `System.String`\n- `System.DateTime`\n- `System.DateTimeOffset`\n- `System.TimeSpan`\n- `Google.Cloud.BigQuery.V2.BigQueryNumeric`\n- `Google.Cloud.BigQuery.V2.BigQueryGeography`\n- A `Google.Cloud.BigQuery.V2.InsertRow` (for record/struct fields)\n- Any `IReadOnlyList\u003cT\u003e` of one of the above types (for repeated fields). This includes arrays and `List\u003cT\u003e` values.\n\n\nNote that all integer types are stored as `System.Int64`, and all floating point\ntypes are stored as `System.Double.`\n\n\n`DateTimeOffset` values are converted to UTC and treated as timestamp. The handling\nof `DateTime` values depends on the `Kind`: values with a `Kind` of `Local` are rejected;\nvalues with a `Kind` of `UTC` are treated as timestamps; values with a `Kind` of `Unspecified`\nare treated as civil datetime values. All values are stored with a precision of a microsecond.\n\n\n`TimeSpan` values must be non-negative and less than 24 hours, used to represent a time-of-day.\n\n\nAlthough date values are retrieved as `System.DateTime`, they must be inserted as string values, in the format\n\"yyyy-MM-dd\".\n\n\n[BigQueryInsertRow](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertRow) is used for record/struct fields for convenience, but only the [InsertId](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertRow#Google_Cloud_BigQuery_V2_BigQueryInsertRow_InsertId)\nof the top-level row is relevant.\n\n\nNull elements within repeated fields are prohibited. This is validated client-side when the row is inserted; validating\nwhen a value is added to the row would be ineffective as the values could change before insertion.\n\nConstructors\n------------\n\n### BigQueryInsertRow()\n\n public BigQueryInsertRow()\n\nConstructs an empty row with no insert ID.\n\n### BigQueryInsertRow(string)\n\n public BigQueryInsertRow(string insertId)\n\nConstructs an empty row with the specified insert ID.\n\nProperties\n----------\n\n### InsertId\n\n public string InsertId { get; set; }\n\nTo help ensure data consistency, you can supply an [InsertId](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertRow#Google_Cloud_BigQuery_V2_BigQueryInsertRow_InsertId) for each inserted row.\nBigQuery remembers this ID for at least one minute. If you try to stream the same set of rows within\nthat time period and the insertId property is set, BigQuery uses the property to de-duplicate\nyour data on a best effort basis. By default if no ID is specified, one will be generated to allow\nde-duplicating efforts if insert operations need to be retried.\nYou can allow empty [InsertId](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryInsertRow#Google_Cloud_BigQuery_V2_BigQueryInsertRow_InsertId) by setting [AllowEmptyInsertIds](/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.InsertOptions#Google_Cloud_BigQuery_V2_InsertOptions_AllowEmptyInsertIds) to true.\nThis will allow for faster row inserts at the expense of possible record duplication if the operation needs to be retried.\nSee \u003chttps://cloud.google.com/bigquery/quotas#streaming_inserts\u003e for more information.\n\n### this\\[string\\]\n\n public object this[string name] { get; set; }\n\nAccesses a field in the row by name.\n\nMethods\n-------\n\n### Add(IDictionary\\\u003cstring, object\\\u003e)\n\n public void Add(IDictionary\u003cstring, object\u003e fields)\n\nAdds all the values in the specified dictionary to the row.\n\n**Remarks** \nThis being named `Add` rather than `AddRange` allows\nit to be specified in a collection initializer, which can be useful\nto provide a set of common fields and then some extra values.\n\n### Add(string, object)\n\n public void Add(string key, object value)\n\nAdds a single field value to the row."]]