title: Usage of spark DataFrame "as" method
body: <p>I am looking at <a href="https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.DataFrame" rel="noreferrer">spark.sql.DataFrame</a> documentation.</p>
  
  <p>There is</p>
  
  <pre><code>def as(alias: String): DataFrame
      Returns a new DataFrame with an alias set.
      Since
          1.3.0 
  </code></pre>
  
  <p>What is the purpose of this method? How is it used? Can there be an example?</p>
  
  <p>I have not managed to find anything about this method online and the documentation is pretty non-existent. I have not managed to make any kind of alias using this method.</p>