title: what's the difference between rdd from PythonRDD and ParallelCollectionRDD
body: <p>I am learning how to program with Spark in Python and struggle with one problem. </p>
  
  <p>The problem is that I have a PythonRDD loaded as id and description: </p>
  
  <pre><code>pythonRDD.take(1)
  ## [('b000jz4hqo', ['clickart', '950', '000', 'premier', 'image', 'pack', 'dvd', 'rom', 'broderbund'])]
  </code></pre>
  
  <p>And ParallelCollectionRDD loaded as id and description:</p>
  
  <pre><code>paraRDD.take(1)
  ## [('b000jz4hqo', ['clickart', '950', '000', 'premier', 'image', 'pack', 'dvd', 'rom', 'broderbund'])]
  </code></pre>
  
  <p>I can do a count on the paraRDD like this:</p>
  
  <pre><code>paraRDD.map(lambda l: (l[0],len(l[1]))).reduce(lambda a,b: a[1] + b[1])
  </code></pre>
  
  <p>or simply </p>
  
  <pre><code>paraRDD.reduce(lambda a,b: len(a[1]) + len(b[1]))
  </code></pre>
  
  <p>but on pythonRDD it ran into bug, the bug says:</p>
  
  <blockquote>
    <p>"TypeError: 'int' object has no attribute '<strong>getitem</strong>'". </p>
  </blockquote>
  
  
  
  <pre><code>def countTokens(vendorRDD):
      return vendorRDD.map(lambda l: (l[0],len(l[1]))).reduce(lambda a,b: a[1] + b[1])
  </code></pre>
  
  <p>Any idea on how this happened would be appreciated?!</p>