Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def s3_select():
- client = boto3.client("s3")
- bucket = "test"
- key = "test.json"
- expression_type = "SQL"
- expression = """SELECT * FROM S3Object"""
- input_serialization = {"JSON": {"Type": "Document"}}
- output_serialization = {"JSON": {}}
- response = client.select_object_content(
- Bucket=bucket,
- Key=key,
- ExpressionType=expression_type,
- Expression=expression,
- InputSerialization=input_serialization,
- OutputSerialization=output_serialization
- )
- for event in response["Payload"]:
- print(event)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement