title: How to add column in a DataFrame with some static values?
body: <p>I have a Spark SQL DataFrame with few columns, but i want to add few more columns in that DataFrame with some static values. How can i do that?</p>
  
  <p>I tried <code>withColumn</code> method , but its expecting <code>Column</code></p>
  
  <p><strong>Expected is:</strong></p>
  
  <pre><code>df.withColumn(col("newColumn", "static value")
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <p>I got the answer, we need to use <code>lit</code> for this purpose.</p>
  
  <p>FOr example:</p>
  
  <pre><code>df.withColumn("newColumn", lit("some value")
  </code></pre>