title: Reading JSON array into Julia DataFrame-like type
body: <p>Given a JSON file, the JSON package happily parses it. But if I would like it as a <code>DataFrame</code> (or any other columnar data structure), what would be a good way to get it?</p>
  
  <p>Currently, for example, I have:</p>
  
  <pre><code>using JSON
  using DataFrames
  
  json_str = """
  [{ "color": "red", "value": "#f00" }, { "color": "green", "value": "#0f0" }, 
   { "color": "blue", "value": "#00f" }, { "color": "cyan", "value": "#0ff" }, 
   { "color": "magenta", "value": "#f0f" }, { "color": "yellow", "value": "#ff0" }, 
   { "color": "black", "value": "#000" } ]
    """
  
  function jsontodf(a)
      ka = union([keys(r) for r in a]...)
      df = DataFrame(;Dict(Symbol(k)=&gt;get.(a,k,NA) for k in ka)...)
      return df
  end
  
  a = JSON.Parser.parse(json_str)
  jsontodf(a)
  </code></pre>
  
  <p>which results in:</p>
  
  <pre><code>7×2 DataFrames.DataFrame
  │ Row │ color     │ value  │
  ├─────┼───────────┼────────┤
  │ 1   │ "red"     │ "#f00" │
  │ 2   │ "green"   │ "#0f0" │
  │ 3   │ "blue"    │ "#00f" │
  │ 4   │ "cyan"    │ "#0ff" │
  │ 5   │ "magenta" │ "#f0f" │
  │ 6   │ "yellow"  │ "#ff0" │
  │ 7   │ "black"   │ "#000" │
  </code></pre>
  
  <p>and also handles some missing fields with NAs. Anything cleaner / faster (Julia v0.6+) ?</p>