title: PySpark sqlContext JSON query all values of an array
body: <p>I currently have a json file that i am trying to query with sqlContext.sql() that looks something like this:</p>
  
  <pre><code>{
    "sample": {
      "persons": [
        {
          "id": "123",
        },
        {
          "id": "456",
        }
      ]
    }
  }
  </code></pre>
  
  <p>If I just want the first value I would type:</p>
  
  <pre><code>sqlContext.sql("SELECT sample.persons[0] FROM test")
  </code></pre>
  
  <p>but I want all the values of "persons" without having to write a loop. Loops just consume too much processing power, and given the size of these files, that would just be impractical.</p>
  
  <p>I thought I would be able to put a range in the [] brackets but I can't find any syntax by which to do that.</p>