public sealed class TableSchemaBuilder : IEnumerableReference documentation and code samples for the Google BigQuery v2 API class TableSchemaBuilder.
Class making it simple to create a TableSchema.
Implements
IEnumerableNamespace
Google.Cloud.BigQuery.V2Assembly
Google.Cloud.BigQuery.V2.dll
Remarks
This class only implements IEnumerable in order to allow it to be used in collection initializers.
Methods
Add(TableFieldSchema)
public void Add(TableFieldSchema field)Adds the given field to the schema being built.
| Parameter | |
|---|---|
| Name | Description |
field |
TableFieldSchemaThe field to add. Must not be null. |
Add(string, TableSchema, BigQueryFieldMode, string)
public void Add(string name, TableSchema nestedSchema, BigQueryFieldMode mode = BigQueryFieldMode.Nullable, string description = null)Creates a nested field with the specified schema, and adds it to the schema being built.
| Parameters | |
|---|---|
| Name | Description |
name |
stringThe name of the field. Must be a valid field name. |
nestedSchema |
TableSchemaThe schema for the nested field. Must not be null. |
mode |
BigQueryFieldModeThe mode of the field. Must be a defined member within BigQueryFieldMode. |
description |
stringThe description of the field. May be null. |
Add(string, BigQueryDbType, BigQueryFieldMode, string)
public void Add(string name, BigQueryDbType type, BigQueryFieldMode mode = BigQueryFieldMode.Nullable, string description = null)Creates a field with the specified details, and adds it to the schema being built.
| Parameters | |
|---|---|
| Name | Description |
name |
stringThe name of the field. Must be a valid field name. |
type |
BigQueryDbTypeThe type of the field. Must be a defined member within BigQueryDbType, other than |
mode |
BigQueryFieldModeThe mode of the field. Must be a defined member within BigQueryFieldMode. |
description |
stringThe description of the field. May be null. |
Add(string, TableSchemaBuilder, BigQueryFieldMode, string)
public void Add(string name, TableSchemaBuilder nestedSchema, BigQueryFieldMode mode = BigQueryFieldMode.Nullable, string description = null)Creates a nested field with the specified schema, and adds it to the schema being built.
This method simply delegates to Add(string, TableSchema, BigQueryFieldMode, string) after calling Build()
on nestedSchema.
| Parameters | |
|---|---|
| Name | Description |
name |
stringThe name of the field. Must be a valid field name. |
nestedSchema |
TableSchemaBuilderThe schema for the nested field, in the form of a TableSchemaBuilder. Must not be null. |
mode |
BigQueryFieldModeThe mode of the field. Must be a defined member within BigQueryFieldMode. |
description |
stringThe description of the field. May be null. |
Build()
public TableSchema Build()Constructs a TableSchema from this builder.
| Returns | |
|---|---|
| Type | Description |
TableSchema |
A TableSchema from the fields added to this builder. |
ModifyField(string, Action<TableFieldSchema>)
public TableSchemaBuilder ModifyField(string fieldName, Action<TableFieldSchema> fieldModifier)Modifies the field with fieldName by running the given action.
| Parameters | |
|---|---|
| Name | Description |
fieldName |
stringThe name of the field to be modified. Must not be null. |
fieldModifier |
ActionTableFieldSchemaAn action to be performed on the given field. |
| Returns | |
|---|---|
| Type | Description |
TableSchemaBuilder |
This TableSchemaBuilder after having applied the modification. For the purposes of method chaining. |
| Exceptions | |
|---|---|
| Type | Description |
ArgumentException |
|