title: How to create an external table for nested Parquet type in redshift spectrum
body: <p>I know redshift and redshift spectrum doesn't support nested type, but I want to know is there any trick that we can bypass that limitation and query our nested data in S3 with Redshift Spectrum?
  In this <a href="http://efimeres.com/2017/11/analyzing-redshift-spectrum/" rel="nofollow noreferrer">post</a> the guy shows how we can do it for JSON files, but it's not the same for Parquet. Do we have any other trick that can be applied on Parquet file?</p>
  
  <p>The actual Schema is something like this: (extracted by AWS-Glue crawler)</p>
  
  <pre><code>CREATE EXTERNAL TABLE `parquet_nested`(
    `event_time` string, 
    `event_id` string, 
    `user` struct&lt;ip_address:string,id:string,country:string&gt;, 
    `device` struct&lt;platform:string,device_id:string,user_agent:string&gt;
    )
  PARTITIONED BY ( 
    `partition_0` string, 
    `partition_1` string, 
    `partition_2` string, 
    `partition_3` string, 
    `partition_4` string)
  ROW FORMAT SERDE 
    'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
  STORED AS INPUTFORMAT 
    'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
  OUTPUTFORMAT 
    'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
  LOCATION
    's3://...'
  </code></pre>