title: Warning message while using a window function in SparkSQL dataframe
body: <p>I am getting the below warning message when I use the window function in SparkSQL. Can anyone please let me know how to fix this issue.</p>
  
  <p>Warning Message:</p>
  
  <p><code>No Partition Defined for Window operation! Moving all data to a single partition, this can cause serious performance degradation.</code></p>
  
  <p>My Code:</p>
  
  <pre class="lang-scala prettyprint-override"><code>def calcPrevBrdrx(df: DataFrame): DataFrame = {
      val w = Window.orderBy("existing_col1")
      df.withColumn("new_col", lag("existing_col2", 1).over(w))
  }
  </code></pre>