It’s not really a “smartness” thing - Jinja comments and SQL comments are useful in different contexts. Sometimes you want to include the result of a commented out jinja statement in your sql, e.g. forcing a dependency in ref or something like this:
--table created at {{ modules.datetime.datetime.now() }}
select *
from {{ ref('my_model') }}
It is a bit confusing that there’s two comment styles, but it’s because there’s actually two languages in use.
FWIW, if you did
/*
select col1
from {{ref(‘table_a’)}}
*/
then you’d be OK as long as the ref resolved. If the model doesn’t exist then you will get an error.
Compare these two:
select id,
--{{ dbt_utils.pivot() }} --this won't work
/*{{ dbt_utils.pivot() }}*/ --this will
from {{ ref('my_model') }}
The former won’t work because only the first line of compiled SQL will be commented out, which is multiple lines. Whereas the block comment will comment out the multiple lines of generated SQL.