Google BigQuery Storage V1 Client - Class AppendRowsRequest (1.4.1)

Reference documentation and code samples for the Google BigQuery Storage V1 Client class AppendRowsRequest.

Request message for AppendRows.

Due to the nature of AppendRows being a bidirectional streaming RPC, certain parts of the AppendRowsRequest need only be specified for the first request sent each time the gRPC network connection is opened/reopened. The size of a single AppendRowsRequest must be less than 10 MB in size. Requests larger than this return an error, typically INVALID_ARGUMENT.

Generated from protobuf message google.cloud.bigquery.storage.v1.AppendRowsRequest

Namespace

Google \ Cloud \ BigQuery \ Storage \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ write_stream string

Required. The write_stream identifies the target of the append operation, and only needs to be specified as part of the first request on the gRPC connection. If provided for subsequent requests, it must match the value of the first request. For explicitly created write streams, the format is: * projects/{project}/datasets/{dataset}/tables/{table}/streams/{id} For the special default stream, the format is: * projects/{project}/datasets/{dataset}/tables/{table}/streams/_default.

↳ offset Google\Protobuf\Int64Value

If present, the write is only performed if the next append offset is same as the provided value. If not present, the write is performed at the current end of stream. Specifying a value for this field is not allowed when calling AppendRows for the '_default' stream.

↳ proto_rows Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ProtoData

Rows in proto format.

↳ trace_id string

Id set by client to annotate its identity. Only initial request setting is respected.

↳ missing_value_interpretations array|Google\Protobuf\Internal\MapField

A map to indicate how to interpret missing value for some fields. Missing values are fields present in user schema but missing in rows. The key is the field name. The value is the interpretation of missing values for the field. For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all missing values in field foo are interpreted as NULL, all missing values in field bar are interpreted as the default value of field bar in table schema. If a field is not in this map and has missing values, the missing values in this field are interpreted as NULL. This field only applies to the current request, it won't affect other requests on the connection. Currently, field name can only be top-level column name, can't be a struct field path like 'foo.bar'.

getWriteStream

Required. The write_stream identifies the target of the append operation, and only needs to be specified as part of the first request on the gRPC connection. If provided for subsequent requests, it must match the value of the first request.

For explicitly created write streams, the format is:

  • projects/{project}/datasets/{dataset}/tables/{table}/streams/{id} For the special default stream, the format is:
  • projects/{project}/datasets/{dataset}/tables/{table}/streams/_default.
Returns
TypeDescription
string

setWriteStream

Required. The write_stream identifies the target of the append operation, and only needs to be specified as part of the first request on the gRPC connection. If provided for subsequent requests, it must match the value of the first request.

For explicitly created write streams, the format is:

  • projects/{project}/datasets/{dataset}/tables/{table}/streams/{id} For the special default stream, the format is:
  • projects/{project}/datasets/{dataset}/tables/{table}/streams/_default.
Parameter
NameDescription
var string
Returns
TypeDescription
$this

getOffset

If present, the write is only performed if the next append offset is same as the provided value. If not present, the write is performed at the current end of stream. Specifying a value for this field is not allowed when calling AppendRows for the '_default' stream.

Returns
TypeDescription
Google\Protobuf\Int64Value|null

hasOffset

clearOffset

getOffsetValue

Returns the unboxed value from getOffset()

If present, the write is only performed if the next append offset is same as the provided value. If not present, the write is performed at the current end of stream. Specifying a value for this field is not allowed when calling AppendRows for the '_default' stream.

Returns
TypeDescription
int|string|null

setOffset

If present, the write is only performed if the next append offset is same as the provided value. If not present, the write is performed at the current end of stream. Specifying a value for this field is not allowed when calling AppendRows for the '_default' stream.

Parameter
NameDescription
var Google\Protobuf\Int64Value
Returns
TypeDescription
$this

setOffsetValue

Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object.

If present, the write is only performed if the next append offset is same as the provided value. If not present, the write is performed at the current end of stream. Specifying a value for this field is not allowed when calling AppendRows for the '_default' stream.

Parameter
NameDescription
var int|string|null
Returns
TypeDescription
$this

getProtoRows

Rows in proto format.

Returns
TypeDescription
Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ProtoData|null

hasProtoRows

setProtoRows

Rows in proto format.

Parameter
NameDescription
var Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest\ProtoData
Returns
TypeDescription
$this

getTraceId

Id set by client to annotate its identity. Only initial request setting is respected.

Returns
TypeDescription
string

setTraceId

Id set by client to annotate its identity. Only initial request setting is respected.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getMissingValueInterpretations

A map to indicate how to interpret missing value for some fields. Missing values are fields present in user schema but missing in rows. The key is the field name. The value is the interpretation of missing values for the field.

For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all missing values in field foo are interpreted as NULL, all missing values in field bar are interpreted as the default value of field bar in table schema. If a field is not in this map and has missing values, the missing values in this field are interpreted as NULL. This field only applies to the current request, it won't affect other requests on the connection. Currently, field name can only be top-level column name, can't be a struct field path like 'foo.bar'.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setMissingValueInterpretations

A map to indicate how to interpret missing value for some fields. Missing values are fields present in user schema but missing in rows. The key is the field name. The value is the interpretation of missing values for the field.

For example, a map {'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all missing values in field foo are interpreted as NULL, all missing values in field bar are interpreted as the default value of field bar in table schema. If a field is not in this map and has missing values, the missing values in this field are interpreted as NULL. This field only applies to the current request, it won't affect other requests on the connection. Currently, field name can only be top-level column name, can't be a struct field path like 'foo.bar'.

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getRows

Returns
TypeDescription
string

static::build

Parameter
NameDescription
writeStream string

Required. The write_stream identifies the target of the append operation, and only needs to be specified as part of the first request on the gRPC connection. If provided for subsequent requests, it must match the value of the first request.

For explicitly created write streams, the format is:

  • projects/{project}/datasets/{dataset}/tables/{table}/streams/{id}

For the special default stream, the format is:

Returns
TypeDescription
Google\Cloud\BigQuery\Storage\V1\AppendRowsRequest