Class StandardSqlDataType (3.3.6)

StandardSqlDataType(type_kind: Optional[google.cloud.bigquery.enums.StandardSqlTypeNames] = <StandardSqlTypeNames.TYPE_KIND_UNSPECIFIED: 'TYPE_KIND_UNSPECIFIED'>, array_element_type: Optional[google.cloud.bigquery.standard_sql.StandardSqlDataType] = None, struct_type: Optional[google.cloud.bigquery.standard_sql.StandardSqlStructType] = None)

The type of a variable, e.g., a function argument.

See: https://cloud.google.com/bigquery/docs/reference/rest/v2/StandardSqlDataType

Examples:

INT64: {type_kind="INT64"}
ARRAY: {type_kind="ARRAY", array_element_type="STRING"}
STRUCT<x STRING, y ARRAY>: {
    type_kind="STRUCT",
    struct_type={
        fields=[
            {name="x", type={type_kind="STRING"}},
            {
                name="y",
                type={type_kind="ARRAY", array_element_type="DATE"}
            }
        ]
    }
}

Inheritance

builtins.object > StandardSqlDataType

Properties

array_element_type

The type of the array's elements, if type_kind is ARRAY.

struct_type

The fields of this struct, in order, if type_kind is STRUCT.

type_kind

The top level type of this field.

Can be any standard SQL data type, e.g. INT64, DATE, ARRAY.

Methods

from_api_repr

from_api_repr(resource: Dict[str, Any])

Construct an SQL data type instance given its API representation.

to_api_repr

to_api_repr()

Construct the API resource representation of this SQL data type.