title: How to create new DataFrame with dict
body: <p>I had one <code>dict</code>, like:</p>
  
  <pre><code>cMap = {"k1" : "v1", "k2" : "v1", "k3" : "v2", "k4" : "v2"}
  </code></pre>
  
  <p>and one DataFrame <code>A</code>, like:</p>
  
  <pre><code>+---+
  |key|
  +----
  | k1|
  | k2|
  | k3|
  | k4|
  +---+
  </code></pre>
  
  <p>to create the DataFame above with code:</p>
  
  <pre><code>data = [('k1'),
      ('k2'),
      ('k3'),
      ('k4')]
  A = spark.createDataFrame(data, ['key'])
  </code></pre>
  
  <p>I want to get the new DataFrame, like:</p>
  
  <pre><code>+---+----------+----------+
  |key|   v1     |    v2    |
  +---+----------+----------+
  | k1|true      |false     |
  | k2|true      |false     |
  | k3|false     |true      |
  | k4|false     |true      |
  +---+----------+----------+
  </code></pre>
  
  <p>I wish to get some suggestions, thanks!</p>