title: How to use dynamic values in Interval in Spark SQL query
body: <p>A working Spark SQL:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT current_timestamp() - INTERVAL 10 DAYS as diff from sample_table
  </code></pre>
  <p>The Spark SQL I tried (non-working):</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT current_timestamp() - INTERVAL col1 DAYS as diff from sample_table
  </code></pre>
  <p>The error gotten from the above query:</p>
  <pre><code>mismatched input 'DAYS' expecting 
  
  == SQL ==
  SELECT current_timestamp() - INTERVAL col1 DAYS as diff from sample_table
  ------------------------------------------^^^
  &quot; Traceback (most recent call last):
      File &quot;/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/session.py&quot;, line 767, in sql return DataFrame(self._jsparkSession.sql(sqlQuery), self._wrapped)
      File &quot;/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py&quot;, line 1257, in call answer, self.gateway_client, self.target_id, self.name)
      File &quot;/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/utils.py&quot;, line 73, in deco raise ParseException(s.split(': ', 1)[1], stackTrace) pyspark.sql.utils.ParseException: &quot;
  mismatched input 'DAYS' expecting 
  
  == SQL ==
  SELECT current_timestamp() - INTERVAL col1 DAYS as diff from sample_table
  ------------------------------------------^^^
  </code></pre>
  <p>I want to use <code>col1</code> as a dynamic interval value. How can I achieve this?</p>