
Answer-first summary for fast verification
Answer: They could wrap the queries using PySpark and use Python’s control flow system to determine when to run the final query.
Wrapping the queries using PySpark and using Python's control flow system to determine when to run the final query is the most feasible solution. This approach allows precise control over which part of the code runs and when, which fits the requirement of running the final query only on Sundays. Other options like submitting a feature request (A), running the entire program on Sundays (C), restricting access to the source table (D), or redesigning the data model (E) are either not practical, overly complex, or do not address the requirement directly.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A data analyst is working with a SQL program that consists of a series of queries. The requirement is to automate the execution of this program on a daily basis. However, there is a specific condition: the final query within the program should only be executed on Sundays. The data analyst has reached out to the data engineering team for assistance in implementing this scheduling logic. Which of the following approaches can the data engineering team utilize to achieve this goal?
A
They could submit a feature request with Databricks to add this functionality.
B
They could wrap the queries using PySpark and use Python’s control flow system to determine when to run the final query.
C
They could only run the entire program on Sundays.
D
They could automatically restrict access to the source table in the final query so that it is only accessible on Sundays.
E
They could redesign the data model to separate the data used in the final query into a new table.
No comments yet.