title: column increased by another column by spark
body: <p>the data source is:</p>
  
  <pre><code>   col1
  ------
      false
      false
      true
      false
      false
      true
      true
      false
  </code></pre>
  
  <p>I add a new column,if value of col1 is true,value col2 increased by 1.
  I expect:</p>
  
  <pre><code>col1,col2
  --
  
      false,0
      false,0
      true,1
      false,1
      false,1
      true,2
      true,3
      false,3
  </code></pre>
  
  <hr>
  
  <p>how to add this?</p>