title: Sum up into a new column from a range of values of a column in Spark using Scala
body: <p>I have a dataframe like below</p>
  
  <pre class="lang-none prettyprint-override"><code>articles
  10
  99
  101
  101
  10005
  1000001
  1000001
  </code></pre>
  
  <p>I want the output dataframe as below</p>
  
  <pre class="lang-none prettyprint-override"><code>range              sum
  1-100              109
  101-10000          202
  10001-1000000      10005
  1000001-100000000  2000002
  ...                ...
  </code></pre>
  
  <p>How to achieve this. I am new to spark and scala.</p>