From 138ee4460946805624289ac20079f922666b004f Mon Sep 17 00:00:00 2001 From: Ari Brown Date: Wed, 31 Jan 2024 16:19:24 -0500 Subject: [PATCH] updated athena query example --- examples/athena_basic_query.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/examples/athena_basic_query.py b/examples/athena_basic_query.py index c48e9d2..11ca08b 100644 --- a/examples/athena_basic_query.py +++ b/examples/athena_basic_query.py @@ -13,17 +13,15 @@ athena = m.athena("s3://haystac-pmo-athena/") # Everything *needs* to have a column in order for unloading to parquet to work, # so scalar values have to be assigned something, so here we use `as count` to # create a temporary column called `count` -#query = athena.query( -# """ -# select round(longitude, 3) as lon, count(*) as count -# from trajectories.basline -# where agent = 4 -# group by round(longitude, 3) -# order by count(*) desc -# """ -#) - -query = athena.query("select * from trajectories.basline where agent < 100 limit 100") +query = athena.query( + """ + select round(longitude, 3) as lon, count(*) as count + from trajectories.basline + where agent = 4 + group by round(longitude, 3) + order by count(*) desc + """ +) data = query.results() pp.pprint(data.head(10))