title: How to select all structures from a dataframe in pyspark?
body: <p>I have a json database loaded using pyspark.</p>
  
  <p>I'm trying to access all "x" components of each structures in it.</p>
  
  <p>This is the output of <code>df.select("level_instance_json.player").printSchema()</code></p>
  
  <pre><code>root
   |-- player: struct (nullable = true)
   |    |-- 0: struct (nullable = true)
   |    |    |-- head_pitch: long (nullable = true)
   |    |    |-- head_roll: long (nullable = true)
   |    |    |-- head_yaw: long (nullable = true)
   |    |    |-- r: long (nullable = true)
   |    |    |-- x: long (nullable = true)
   |    |    |-- y: long (nullable = true)
   |    |-- 1: struct (nullable = true)
   |    |    |-- head_pitch: long (nullable = true)
   |    |    |-- head_roll: long (nullable = true)
   |    |    |-- head_yaw: long (nullable = true)
   |    |    |-- r: long (nullable = true)
   |    |    |-- x: long (nullable = true)
   |    |    |-- y: long (nullable = true)
  ...
  </code></pre>
  
  <p>I've tried selecting all using the '*' selector but it doesn't work.
  <code>df.select("level_instance_json.player.*.x").show(10)</code> gives this error:</p>
  
  <pre><code>'No such struct field * in 0, 1, 10, 100, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 101, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 102,...
  </code></pre>