Recall & Review
beginner Click to reveal answer
What is the purpose of the SqlOperator in Airflow?
SqlOperator is used to run SQL queries or commands on a database within an Airflow workflow.
beginner Click to reveal answer
Which parameter specifies the database connection in SqlOperator?
The parameter 'conn_id' specifies the Airflow connection ID to the target database.
beginner Click to reveal answer
How do you pass the SQL query to SqlOperator?
You pass the SQL query as a string to the 'sql' parameter in SqlOperator.
intermediate Click to reveal answer
Can SqlOperator execute multiple SQL statements at once?
Yes, SqlOperator can execute multiple SQL statements if they are separated properly in the 'sql' parameter.
intermediate Click to reveal answer
What happens if the SQL query in SqlOperator fails during execution?
If the SQL query fails, the task will fail and Airflow will mark the task as failed, triggering retries or alerts if configured.
What parameter do you use to specify the SQL query in SqlOperator?
✗ Incorrect
The 'sql' parameter is used to provide the SQL query string to SqlOperator.
Which parameter connects SqlOperator to the database?
✗ Incorrect
'conn_id' is the Airflow connection ID that links SqlOperator to the database.
What happens if the SQL query in SqlOperator fails?
✗ Incorrect
If the SQL query fails, the task fails and Airflow can retry or alert based on configuration.
Can SqlOperator run multiple SQL statements in one task?
✗ Incorrect
SqlOperator can run multiple SQL statements if they are separated correctly in the 'sql' parameter.
Which Airflow component uses SqlOperator?
✗ Incorrect
SqlOperator is used as a task inside a DAG to run SQL queries.
Explain how to use SqlOperator to run a SQL query in an Airflow DAG.
Think about how you connect to the database and provide the SQL command.
You got /4 concepts.
Describe what happens when a SQL query executed by SqlOperator fails.
Consider Airflow's behavior on task errors.
You got /3 concepts.
