Skip to content

Commit

Permalink
Add order by to bigquery queries to make sure we create manifests in …
Browse files Browse the repository at this point in the history
…asc order (#5074)
  • Loading branch information
lcouzens authored Apr 30, 2024
1 parent 80d964b commit 103c876
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions koku/masu/external/downloader/gcp/gcp_report_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ def bigquery_export_to_partition_mapping(self):
try:
client = bigquery.Client()
export_partition_date_query = f"""
SELECT DATE(_PARTITIONTIME), DATETIME(max(export_time)) FROM {self.table_name}
SELECT DATE(_PARTITIONTIME) AS partition_date, DATETIME(max(export_time)) FROM {self.table_name}
WHERE DATE(_PARTITIONTIME) BETWEEN '{self.scan_start}'
AND '{self.scan_end}' GROUP BY DATE(_PARTITIONTIME)
AND '{self.scan_end}' GROUP BY partition_date ORDER BY partition_date
"""
eq_result = client.query(export_partition_date_query).result()
for row in eq_result:
Expand Down

0 comments on commit 103c876

Please sign in to comment.