I would like to use variables in a SQL transformations, trying the syntax shown in this StackOverflow article. However, the following SQL fails with the message “Query is not safe for execution. It must not contain commands like CREATE, DROP, INSERT, etc., but found node: SetCommand.” How can I use SQL variables with this Spark implementation?
SET startDate="2023-01-01"
SET endDate="2023-12-31"
SELECT explode(sequence(to_timestamp(${startDate}), to_timestamp(${endDate}), interval 12 hours)) AS timestamp