S3 Select retrieve headers in the CSV
问题 I am trying to fetch a subset of records from a CSV stored in an S# bucket using the following 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[