title: S3 Select retrieve headers in the CSV
body: <p>I am trying to fetch a subset of records from a CSV stored in an S# bucket using the following code:</p>
  
  <pre><code>s3 = boto3.client('s3')
  bucket = bucket
  file_name = file
  
  sql_stmt = """SELECT S.* FROM s3object S LIMIT 10"""
  
  
  req = s3.select_object_content(
      Bucket=bucket,
      Key=file,
      ExpressionType='SQL',
      Expression=sql_stmt,
      InputSerialization = {'CSV': {'FileHeaderInfo': 'USE'}},
      OutputSerialization = {'CSV': {}},
  )
  
  records = []
  for event in req['Payload']:
      if 'Records' in event:
          records.append(event['Records']['Payload'])
      elif 'Stats' in event:
          stats = event['Stats']['Details']
  
  
  file_str = ''.join(r.decode('utf-8') for r in records)
  
  select_df = pd.read_csv(StringIO(file_str))
  df = pd.DataFrame(select_df)
  print(df)
  </code></pre>
  
  <p>This successfully yields the records but misses out on headers.</p>
  
  <p>I read here <a href="https://stackoverflow.com/questions/50848573/s3-select-csv-headers">S3 Select CSV Headers</a> that S3 Select does not yield headers at all. So, is it possible to retrieve the headers of a CSV file in S3 in any other way?</p>