title: How to combine or merge two sparse vectors in Spark using Java?
body: <p>I used the Java's API, i.e. Apache-Spark 1.2.0, and created two parse vectors as follows.</p>
  
  <pre><code>Vector v1 = Vectors.sparse(3, new int[]{0, 2}, new double[]{1.0, 3.0});
  Vector v2 = Vectors.sparse(2, new int[]{0, 1}, new double[]{4,5});
  </code></pre>
  
  <p>How can I get a new vector <code>v3</code> that is formed by combining <code>v1</code> and <code>v2</code>, so the result should be: <code>(5, [0,2,3,4],[1.0, 3.0, 4.0, 5.0])</code></p>