BigQuery Client - Class ValueMapper (1.24.2)

Reference documentation and code samples for the BigQuery Client class ValueMapper.

Maps values to their expected BigQuery types. This class is intended for internal use only.

Methods

__construct

Parameter
NameDescription
returnInt64AsObject bool

If true, 64 bit integers will be returned as a {@see \Google\Cloud\Core\Int64} object for 32 bit platform compatibility.

fromBigQuery

Maps a value coming from BigQuery to the expected format for use in the library.

Parameters
NameDescription
value array

The value to map.

schema array

The schema describing the value.

toBigQuery

Maps a user provided value to the expected BigQuery format.

Parameter
NameDescription
value mixed

The value to map.

Returns
TypeDescription
mixed

toParameter

Maps a value to the expected parameter format.

Parameter
NameDescription
value mixed

The value to map.

Returns
TypeDescription
array

Constants

TYPE_BOOL

Value: 'BOOL'

TYPE_BOOLEAN

Value: 'BOOLEAN'

TYPE_INT64

Value: 'INT64'

TYPE_INTEGER

Value: 'INTEGER'

TYPE_FLOAT64

Value: 'FLOAT64'

TYPE_FLOAT

Value: 'FLOAT'

TYPE_NUMERIC

Value: 'NUMERIC'

TYPE_BIGNUMERIC

Value: 'BIGNUMERIC'

TYPE_STRING

Value: 'STRING'

TYPE_BYTES

Value: 'BYTES'

TYPE_DATE

Value: 'DATE'

TYPE_DATETIME

Value: 'DATETIME'

TYPE_TIME

Value: 'TIME'

TYPE_TIMESTAMP

Value: 'TIMESTAMP'

TYPE_ARRAY

Value: 'ARRAY'

TYPE_STRUCT

Value: 'STRUCT'

TYPE_RECORD

Value: 'RECORD'

TYPE_GEOGRAPHY

Value: 'GEOGRAPHY'

DATETIME_FORMAT

Value: 'Y-m-d H:i:s.u'

DATETIME_FORMAT_INSERT

Value: 'Y-m-d\\TH:i:s.u'