Skip to content

Commit 6bd2e3e

Browse files
authored
[skip changelog] Add missing partitioning query in Athena script (arduino#1477)
1 parent 7d22144 commit 6bd2e3e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/tools/fetch_athena_stats.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def execute(client, statement, dest_s3_output_location):
1818
result = client.start_query_execution(
1919
QueryString=statement,
2020
ClientRequestToken=str(uuid.uuid4()),
21-
QueryExecutionContext={"Database": "etl_kpi_prod_hwfw"},
2221
ResultConfiguration={
2322
"OutputLocation": dest_s3_output_location,
2423
},
@@ -113,6 +112,9 @@ def convert_data(data):
113112
session = boto3.session.Session(region_name="us-east-1")
114113
athena_client = session.client("athena")
115114

115+
# Load all partitions before querying downloads
116+
execute(athena_client, f"MSCK REPAIR TABLE {AWS_ATHENA_SOURCE_TABLE};", DEST_S3_OUTPUT)
117+
116118
query = f"""SELECT replace(json_extract_scalar(url_decode(url_decode(querystring)),
117119
'$.data.url'), 'https://downloads.arduino.cc/arduino-cli/arduino-cli_', '')
118120
AS flavor, count(json_extract(url_decode(url_decode(querystring)),'$')) AS gauge

0 commit comments

Comments
 (0)