title: Calling collect() on Spark custom RDD resulting in an empty collection
body: <p>For the following RDD (relevant sections shown):</p>
  
  <pre><code>val myRdd = new RDD[RddOutput](zippedRows) {
  
    override def compute(split: Partition, context: TaskContext): Iterator[RddOutput] = {
         ..
        val out =  // computes a list of items
      }
      out.toIterator  // Breakpoint set here: out is non-empty
    }
  
  }
  </code></pre>
  
  <p>When invoking the rdd:</p>
  
  <pre><code>val outVects = myRdd.collect
  val veclen = outVects(0).size    // outVects is null!
  </code></pre>
  
  <p>So as the comments note: the output iterator withint the compute() is non-empty but then there is no data returned from the collect() invocation.   Any ideas?</p>