Created
July 9, 2024 15:13
-
-
Save samredai/61c05779b64c5ddd64bfed641d35c102 to your computer and use it in GitHub Desktop.
Python: An example of querying trino using sqlalchemy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install trino | |
from sqlalchemy.engine import create_engine | |
import pandas as pd | |
uri = "trino://localhost:8080/tpch/sf1" | |
engine = create_engine(uri, connect_args={'http_scheme': 'http', 'user': 'admin'}) | |
connection = engine.connect() | |
df = pd.read_sql("select * from customer", connection) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment