title: How to use a variable in place of column names when doing select in Pyspark/Sparksql
body: <p>I have a variable with column names in it, like below:</p>
  
  <p>VAR=Fullname,Address,DOB</p>
  
  <p>I need to pass this variable in my spark sql instead of column names like below:</p>
  
  <pre><code>spark.sql("""
             Select
             VAR
             From mytable
             where 1=1
             #some additional filters
             """)
  </code></pre>
  
  <p>so it is treated as if I was giving the column names explicitly like below:</p>
  
  <pre><code>spark.sql("""
             Select
             Fullname
             ,Address
             ,DOB
             From mytable
             where 1=1
             #some additional filters
             """)
  </code></pre>
  
  <p>how can this be implemented using pyspark/sparksql</p>