title: Amazon AWS Athena HIVE_CANNOT_OPEN_SPLIT: Error opening Hive split / Not valid Parquet file, parquet files compress to gzip with Athena
body: <p>I'm trying to build skills on Amazon Athena.
  I have already successed to query data in JSON and Apache Parquet format with Athena.
  What I'm trying to do now is add compression (gzip) to it.</p>
  
  <p>My JSON Data : </p>
  
  <pre><code>{
      "id": 1,
      "prenom": "Firstname",
      "nom": "Lastname",
      "age": 23
  }
  </code></pre>
  
  <p>Then, I transform the JSON into Apache Parquet format with an npm module : <a href="https://www.npmjs.com/package/parquetjs" rel="nofollow noreferrer">https://www.npmjs.com/package/parquetjs</a></p>
  
  <p>And finally, I compress the parquet file I get in GZIP format and put it in my s3 bucket : test-athena-personnes.</p>
  
  <p>My Athena Table : </p>
  
  <pre><code>CREATE EXTERNAL TABLE IF NOT EXISTS personnes (
      id INT,
      nom STRING,
      prenom STRING,
      age INT
  ) 
  STORED AS PARQUET
  LOCATION 's3://test-athena-personnes/'
  tblproperties ("parquet.compress"="GZIP");
  </code></pre>
  
  <p>Then, to test it, I launch a very simple request:  <code>Select * from personnes;</code></p>
  
  <p>I get the error message :</p>
  
  <pre><code>HIVE_CANNOT_OPEN_SPLIT: Error opening Hive split s3://test-athena-personnes/personne1.parquet.gz (offset=0, length=257): Not valid Parquet file: s3://test-athena-personnes/personne1.parquet.gz expected magic number: [80, 65, 82, 49] got: [-75, 1, 0, 0]
  </code></pre>
  
  <p>Is there anything I didn't understand or that I'm doing bad?  I can request apache parquet files without using gzip compression but not with it.</p>
  
  <p>Thank you in advance</p>