Class ArrayQueryParameter (3.21.0)

ArrayQueryParameter(name, array_type, values)

Named / positional query parameters for array values.

Parameters

Name Description
name Optional[str]

Parameter name, used via @foo syntax. If None, the parameter can only be addressed via position (?).

array_type Union[str, ScalarQueryParameterType, StructQueryParameterType]

The type of array elements. If given as a string, it must be one of 'STRING', 'INT64', 'FLOAT64', 'NUMERIC', 'BIGNUMERIC', 'BOOL', 'TIMESTAMP', 'DATE', or 'STRUCT'/'RECORD'. If the type is 'STRUCT'/'RECORD' and values is empty, the exact item type cannot be deduced, thus a StructQueryParameterType instance needs to be passed in.

values List[appropriate type]

The parameter array values.

Methods

from_api_repr

from_api_repr(resource: dict) -> google.cloud.bigquery.query.ArrayQueryParameter

Factory: construct parameter from JSON resource.

Parameter
Name Description
resource Dict

JSON mapping of parameter

Returns
Type Description
google.cloud.bigquery.query.ArrayQueryParameter Instance

positional

positional(
    array_type: str, values: list
) -> google.cloud.bigquery.query.ArrayQueryParameter

Factory for positional parameters.

Parameters
Name Description
array_type Union[str, ScalarQueryParameterType, StructQueryParameterType]

The type of array elements. If given as a string, it must be one of 'STRING', 'INT64', 'FLOAT64', 'NUMERIC', 'BIGNUMERIC', 'BOOL', 'TIMESTAMP', 'DATE', or 'STRUCT'/'RECORD'. If the type is 'STRUCT'/'RECORD' and values is empty, the exact item type cannot be deduced, thus a StructQueryParameterType instance needs to be passed in.

values List[appropriate type]

The parameter array values.

Returns
Type Description
google.cloud.bigquery.query.ArrayQueryParameter Instance without name

to_api_repr

to_api_repr() -> dict

Construct JSON API representation for the parameter.

Returns
Type Description
Dict JSON mapping