Comment on page
COUNT_VALUES_IF
Returns the amount of
true
values in a given array. This can be used with conditional operators to count the number of array elements that fulfil a condition. For example, COUNT_VALUES_IF(my_values[] > 3) will return the number of elements that are greater than 3.COUNT_VALUES_IF(input)
Name | Type | Description | Default Value |
---|---|---|---|
input | boolean | The input array | |
the number of times
true
appeared in the input array. a primitive value is considered to be an array with one element.input | Output |
---|---|
null::boolean | 0 |
array[true, false, true] | 2 |
CREATE JOB function_operator_example
ADD_MISSING_COLUMNS = true
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAME
SELECT input,
COUNT_VALUES_IF(input) AS Output
FROM default_glue_catalog.upsolver_samples.orders_raw_data
LET input = null::boolean
WHERE time_filter()
LIMIT 1;
input | Output |
---|---|
null::boolean | 0 |
Last modified 3mo ago