Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def s3_select():
  2. client = boto3.client("s3")
  3. bucket = "test"
  4. key = "test.json"
  5. expression_type = "SQL"
  6. expression = """SELECT * FROM S3Object"""
  7. input_serialization = {"JSON": {"Type": "Document"}}
  8. output_serialization = {"JSON": {}}
  9. response = client.select_object_content(
  10. Bucket=bucket,
  11. Key=key,
  12. ExpressionType=expression_type,
  13. Expression=expression,
  14. InputSerialization=input_serialization,
  15. OutputSerialization=output_serialization
  16. )
  17. for event in response["Payload"]:
  18. print(event)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement