title: dbt query to Snowflake resulting in an "invalid identifier" error for a column that exists
body: <p>I've been pulling my hair out for several hours trying to understand what's going on, to no avail so far.</p>
  <p>I've got this query on dbt:</p>
  <pre><code>{{
    config(
      materialized='incremental',
      unique_key='event_ID'
    )
  }}
  
  SELECT
      {{ dbt_utils.star(from=ref('staging_pg_ahoy_events'), relation_alias='events', prefix='event_') }},
      {{ dbt_utils.star(from=ref('staging_pg_ahoy_visits'), relation_alias='visits', prefix='visit_') }}
  FROM
      {{ ref('staging_pg_ahoy_events') }} AS events
  LEFT JOIN {{ ref('staging_pg_ahoy_visits') }} AS visits ON events.visit_id = visits.id
  
  {% if is_incremental() %}
      WHERE &quot;events&quot;.&quot;event_ID&quot; &gt;= (SELECT max(&quot;events&quot;.&quot;event_ID&quot;) FROM {{ this }})
  {% endif %}
  </code></pre>
  <p>Along with this config:</p>
  <pre class="lang-yaml prettyprint-override"><code>version: 2
  
  models:
    - name: facts_ahoy_events
      columns:
        - name: event_ID
          quote: true
          tests:
            - unique
            - not_null
  </code></pre>
  <p><code>dbt run -m facts_ahoy_events --full-refresh</code> runs successfully, however when I try an incremental backup by dropping the <code>--full-refresh</code> flag, the following error ensues:</p>
  <pre><code>10:35:51  1 of 1 START incremental model DBT_PCOISNE.facts_ahoy_events.................... [RUN]
  10:35:52  1 of 1 ERROR creating incremental model DBT_PCOISNE.facts_ahoy_events........... [ERROR in 0.88s]
  10:35:52  
  10:35:52  Finished running 1 incremental model in 3.01s.
  10:35:52  
  10:35:52  Completed with 1 error and 0 warnings:
  10:35:52  
  10:35:52  Database Error in model facts_ahoy_events (models/marts/facts/facts_ahoy_events.sql)
  10:35:52    000904 (42000): SQL compilation error: error line 41 at position 10
  10:35:52    invalid identifier '&quot;events&quot;.&quot;event_ID&quot;'
  </code></pre>
  <p>I've gotten used to the case-sensitive column names on Snowflake, but I can't for the life of me figure out what's going on, since the following query run directly on Snowflake, completes:</p>
  <pre class="lang-sql prettyprint-override"><code>select &quot;event_ID&quot; from DBT_PCOISNE.FACTS_AHOY_EVENTS limit 10;
  </code></pre>
  <p>Whereas this one expectedly fails:</p>
  <pre class="lang-sql prettyprint-override"><code>select event_ID from DBT_PCOISNE.FACTS_AHOY_EVENTS limit 10;
  </code></pre>
  <p>I think I've tried every combination of upper, lower, and mixed casing, each with and without quoting, but all my attempts have failed.</p>
  <p>Any help or insight would be greatly appreciated!
  Thank you</p>