Skip to content

Commit

Permalink
Added PricingCategory for AWS (#284). (#330)
Browse files Browse the repository at this point in the history
* Added PricingCategory for AWS (#284).

Signed-off-by: Varun Mittal <[email protected]>
  • Loading branch information
varunmittal91 authored Mar 4, 2024
1 parent dfc832e commit 337e595
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ conversion_args:
dtype: datetime
- column_name: bill/PayerAccountId
dtype: string
- column_name: product/PurchaseOption
dtype: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plan_name: conversion plan for PricingCategory
conversion_type: sql_query
conversion_args: >
SELECT
*,
CASE
WHEN ("product/PurchaseOption" = 'On-Demand') THEN 'On-Demand'
WHEN ("product/PurchaseOption" = 'Reserved Instances') THEN 'Commitment-Based'
WHEN ("product/PurchaseOption" = 'Spot Instances') THEN 'Dynamic'
WHEN ("product/PurchaseOption" = 'Dedicated Hosts') THEN 'On-Demand'
ELSE NULL
END AS PricingCategory
FROM {{ TABLE_NAME }}
column: NA
focus_column: PricingCategory
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ conversion_args:
dtype: float
- column_name: line_item_resource_id
dtype: string
- column_name: product_purchase_option
dtype: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plan_name: conversion plan for PricingCategory
conversion_type: sql_query
conversion_args: >
SELECT
*,
CASE
WHEN ("product_purchase_option" = 'On-Demand') THEN 'On-Demand'
WHEN ("product_purchase_option" = 'Reserved Instances') THEN 'Commitment-Based'
WHEN ("product_purchase_option" = 'Spot Instances') THEN 'Dynamic'
WHEN ("product_purchase_option" = 'Dedicated Hosts') THEN 'On-Demand'
ELSE NULL
END AS PricingCategory
FROM {{ TABLE_NAME }}
column: NA
focus_column: PricingCategory

0 comments on commit 337e595

Please sign in to comment.