Athena客户端在Amazon Athena上执行查询
python-athena的Python项目详细描述
皮雅典娜
用于查询Athena数据库的Python客户端。查询结果的格式为pandas数据框。
安装
pip install git+https://github.com/yardstick17/PyAthena.git
使用量
In[9]:fromathenaimportAthenaIn[10]:query="""SELECT col1, col2, col3, col3 FROM "database"."table1" WHERE col1 = 'PI912A0CV-O12' AND col2 = '2019-03-04' AND schema='best_model_ever' """In[11]:df=athena_client.execute_with_pandas(query=query)In[12]:df.head()Out[12]:col1col2col3col30PI912A0CV-O122019-03-040.02.6231551PI912A0CV-O122019-03-040.02.0952562PI912A0CV-O122019-03-040.01.9049613PI912A0CV-O122019-03-040.00.8293324PI912A0CV-O122019-03-040.00.058469