{% macro value_length(column, expected_length, where) %}
  SELECT
    IF(
    COUNTIF(LENGTH({{ column }}) <> {{ expected_length }}) > 0,
    ERROR("Column: `{{ column }}` has values of unexpected length."),
    NULL
    )
  FROM `{{ project_id }}.{{ dataset_id }}.{{ table_name }}`
  {% if where %}
  WHERE {{ where }}
  {% endif %};
{% endmacro %}
