Skip to content

Commit

Permalink
Added partitioned column to improve billing BigQuery (#891)
Browse files Browse the repository at this point in the history
* Added partinioned column to improve billing BigQuery

* Fixed version

* Bumped version
  • Loading branch information
jdesouza authored Apr 10, 2024
1 parent 2811fae commit 3c4a4ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions plugins/cloud-costs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.2.0
* Added partition column to GCP big query

## 0.1.10
* Fixed AWS file name

Expand Down
2 changes: 1 addition & 1 deletion plugins/cloud-costs/cloud-costs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ if [[ "$provider" == "gcp" ]]; then

echo "Google bigquey is running......"

sql="SELECT main.* FROM \`$table\` AS main LEFT JOIN UNNEST(labels) as labels WHERE labels.key = '$tagkey' AND labels.value = '$tagvalue' and usage_start_time >= '$initial_date_time' AND usage_start_time < '$final_date_time' order by usage_start_time desc"
sql="SELECT main.* FROM \`$table\` AS main LEFT JOIN UNNEST(labels) as labels WHERE labels.key = '$tagkey' AND labels.value = '$tagvalue' and usage_start_time >= '$initial_date_time' AND usage_start_time < '$final_date_time' AND TIMESTAMP_TRUNC(_PARTITIONTIME, DAY) >= '$initial_date_time' AND TIMESTAMP_TRUNC(_PARTITIONTIME, DAY) <= '$final_date_time' order by usage_start_time desc"
bq --format=prettyjson query --max_rows=10000000 --nouse_legacy_sql "$sql" > /output/cloudcosts-tmp.json
echo "Google bigquey finished......"

Expand Down
2 changes: 1 addition & 1 deletion plugins/cloud-costs/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.10
0.2.0

0 comments on commit 3c4a4ef

Please sign in to comment.