Bird
0
0

Identify the error in this macro definition:

medium📝 Debug Q14 of 15
dbt - Jinja in dbt
Identify the error in this macro definition:
{% macro get_orders() %}
SELECT * FROM orders
AMacro name cannot have underscores
BMissing {% endmacro %} tag to close the macro
CSELECT statement must be inside double quotes
DMacro cannot return SELECT statements
Step-by-Step Solution
Solution:
  1. Step 1: Check macro syntax

    Macros must start with {% macro %} and end with {% endmacro %} tags.
  2. Step 2: Identify incorrect closing tag

    The macro incorrectly uses instead of {% endmacro %}.
  3. Final Answer:

    Missing {% endmacro %} tag to close the macro -> Option B
  4. Quick Check:

    Macro must end with {% endmacro %} [OK]
Quick Trick: Always close macros with {% endmacro %} [OK]
Common Mistakes:
MISTAKES
  • Using HTML-like closing tags
  • Thinking underscores are invalid
  • Believing SELECT needs quotes in macros

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes