Complete the code to access the current model's name using a built-in Jinja variable.
SELECT * FROM {{ [1].this }}model instead of this.ref which is for referencing other models.The this variable in dbt's Jinja context refers to the current model's full identifier, which can be used to reference the model itself.
Complete the code to get the current model's schema using a built-in Jinja variable.
SELECT schema_name FROM information_schema.schemata WHERE schema_name = '{{ [1].schema }}'
target.schema which refers to the target schema for the run, not the model's schema.config.schema which is for configuration settings.The this.schema variable gives the schema name of the current model in dbt.
Fix the error in the code to correctly access the current model's alias using a built-in Jinja variable.
SELECT '{{ [1].alias }}' AS model_alias
target.alias which does not exist.config.alias which is for configuration.The this.alias variable holds the alias of the current model in dbt.
Fill both blanks to create a dictionary comprehension that maps each column name to its data type from the current model's columns.
{ [1]: [2] for col in this.columns }col.type which is not a valid attribute.col.column_name which is not the correct attribute.Each column object has a name and data_type attribute. The comprehension maps column names to their data types.
Fill all three blanks to create a filter that selects columns with data type 'string' and length greater than 10 from the current model's columns.
{col.name: col.data_type for col in this.columns if col.data_type == '[1]' and col.character_maximum_length [2] [3]This comprehension filters columns where the data type is 'string' and the maximum character length is greater than 10.