我能够通过Lambda函数查询Redshift-
def lambda_handler(event, context):
print("Received event: " + json.dumps(event, indent=2))
conn_string = "my database connection"
conn = psycopg2.connect(conn_string)
cursor = conn.cursor()
print (cursor.execute("select id from members limit 100"))
conn.commit()
rows = cursor.fetchall()
for r in rows:
print(r)
cursor.close()
如何将在rows
中获得的查询结果写入S3?