Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more samples using 3rd party tools for Athena #606

Closed
MarcelStranak opened this issue Apr 27, 2023 · 0 comments · Fixed by #1269
Closed

add more samples using 3rd party tools for Athena #606

MarcelStranak opened this issue Apr 27, 2023 · 0 comments · Fixed by #1269
Assignees

Comments

@MarcelStranak
Copy link
Contributor

It might be helpful to add more samples.
pyathena, awswrangler, sqlalchemy

Pyathena

from pyathena import connect

conn = connect(
    s3_staging_dir="s3://s3-results-bucket/output/",
    region_name="us-east-1",
    endpoint_url="http://localhost:4566",
)
cursor = conn.cursor()

cursor.execute("CREATE DATABASE IF NOT EXISTS testdb")
cursor.execute(
    "CREATE TABLE IF NOT EXISTS testdb.testtable (col1 int,col2 int,col3 int)"
)
cursor.execute(
    "INSERT INTO testdb.testtable (col1,col2,col3) VALUES (1,2,3),(4,5,6),(7,8,9)"
)
cursor.execute("SELECT * from testdb.testtable")
print(cursor.fetchall())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants