title: convert data type from org.apache.spark.sql.Column to Long in spark window functions
body: <p>I am performing an operation in scala dataframe using window functions.</p>
  <p>But  I am getting an error as shown below while processing.</p>
  <pre><code>error: type mismatch;
   found   : org.apache.spark.sql.Column
   required: Long
  val w4 = Window.partitionBy(&quot;ID&quot;).orderBy(&quot;date&quot;).rowsBetween((lit(Window.currentRow)-col(&quot;null_count&quot;)), Window.currentRow)
  </code></pre>
  <p>Below provided part is causing the issue, rowsBetween function is expecting Long data type as start and end limit parameter.</p>
  <pre><code>rowsBetween((lit(Window.currentRow)-col(&quot;null_count&quot;)), Window.currentRow)
  </code></pre>
  <p>Since the window upper limit is not static, it has to take value from another column (<strong>null_count</strong>). Is there any way to resolve this issue ?</p>
  <p>Any Leads Appreciated !</p>