title: PySpark difference between pyspark.sql.functions.col and pyspark.sql.functions.lit
body: <p>I find it hard to understand the difference between these two methods from <code>pyspark.sql.functions</code> as the documentation on PySpark official website is not very informative. For example the following code:</p>
  
  <pre class="lang-py prettyprint-override"><code>import pyspark.sql.functions as F
  print(F.col('col_name'))
  print(F.lit('col_name'))
  </code></pre>
  
  <p>The results are:</p>
  
  <pre><code>Column&lt;b'col_name'&gt;
  Column&lt;b'col_name'&gt;
  </code></pre>
  
  <p>so what are the difference between the two and when should I use one and not the other?</p>