BigQuery
Platform-specific data type examples:
unit_tests:
- name: test_my_data_types
model: fct_data_types
given:
- input: ref('stg_data_types')
rows:
- int_field: 1
float_field: 2.0
str_field: my_string
str_escaped_field: "my,cool'string"
date_field: 2020-01-02
timestamp_field: 2013-11-03 00:00:00-0
timestamptz_field: 2013-11-03 00:00:00-0
bigint_field: 1
geography_field: 'st_geogpoint(75, 45)'
json_field: {"name": "Cooper", "forname": "Alice"}
str_array_field: ['a','b','c']
int_array_field: [1, 2, 3]
date_array_field: ['2020-01-01']
struct_field: 'struct("Isha" as name, 22 as age)'
struct_of_struct_field: 'struct(struct(1 as id, "blue" as color) as my_struct)'
struct_array_field: ['struct(st_geogpoint(75, 45) as my_point)', 'struct(st_geogpoint(75, 35) as my_point)']
# Make sure to include **all** the fields in a BigQuery `struct` within the unit test.
# It's not currently possible to use only a subset of columns in a 'struct'