title: Proper subgraphing of a PySpark GraphFrame
body: <p><a href="http://graphframes.github.io/quick-start.html" rel="nofollow">graphframes</a> is a network analysis tool based on PySpark DataFrames. The following code is a modified version of the tutorial subgraphing example:</p>
  
  <pre><code>from graphframes.examples import Graphs
  import graphframes
  g = Graphs(sqlContext).friends()  # Get example graph
  # Select subgraph of users older than 30
  v2 = g.vertices.filter("age &gt; 30")
  g2 = graphframes.GraphFrame(v2, g.edges)
  </code></pre>
  
  <p>One would expect that the new graph, <code>g2</code> will contain fewer nodes and fewer edges, compared to the original one, <code>g</code>. 
  However, this is not the case:</p>
  
  <pre><code>print(g.vertices.count(), g.edges.count())
  print(g2.vertices.count(), g2.edges.count())
  </code></pre>
  
  <p>Gives the output:</p>
  
  <pre><code>(6, 7)
  (7, 4)
  </code></pre>
  
  <p>It is obvious that the resulting graph contains edges for non-existing nodes.
  Even more disturbing is the fact that <code>g.degrees</code> and <code>g2.degrees</code> are identical. This means that at least some of graph functionality ignores the nodes information.  Is there a good way to make sure that <code>GraphFrame</code> creates
  a graph using only the intersection of the supplied <code>nodes</code> and <code>edges</code> arguments?</p>