Order SparseVectors by the closest distance to given SparseVector
it appears that problem was solved with BucketedRandomProjectionLSH. After fit &amp;&amp; transformation, and approxNearestNeighbors resulted dataset contains distCol, which (as per LSH.scala):


  @param distCol Output column for storing the distance between each result row and the key.