Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update view to match with the latest CUR report schema #2

Open
wants to merge 1 commit into
base: master
from

Conversation

@chenrui333
Copy link

chenrui333 commented Jan 3, 2020

CUR report schema reference:

CREATE EXTERNAL TABLE cur_report(
	identity_line_item_id STRING,
	identity_time_interval STRING,
	bill_invoice_id STRING,
	bill_billing_entity STRING,
	bill_bill_type STRING,
	bill_payer_account_id STRING,
	bill_billing_period_start_date TIMESTAMP,
	bill_billing_period_end_date TIMESTAMP,
	line_item_usage_account_id STRING,
	line_item_line_item_type STRING,
	line_item_usage_start_date TIMESTAMP,
	line_item_usage_end_date TIMESTAMP,
	line_item_product_code STRING,
	line_item_usage_type STRING,
	line_item_operation STRING,
	line_item_availability_zone STRING,
	line_item_resource_id STRING,
	line_item_usage_amount DOUBLE,
	line_item_normalization_factor DOUBLE,
	line_item_normalized_usage_amount DOUBLE,
	line_item_currency_code STRING,
	line_item_unblended_rate STRING,
	line_item_unblended_cost DOUBLE,
	line_item_blended_rate STRING,
	line_item_blended_cost DOUBLE,
	line_item_line_item_description STRING,
	line_item_tax_type STRING,
	line_item_net_unblended_rate STRING,
	line_item_net_unblended_cost DOUBLE,
	line_item_legal_entity STRING,
	product_product_name STRING,
	product_alarm_type STRING,
	product_attachment_type STRING,
	product_availability STRING,
	product_availability_zone STRING,
	product_cache_engine STRING,
	product_cache_memory_size_gb STRING,
	product_capacitystatus STRING,
	product_category STRING,
	product_clock_speed STRING,
	product_content_type STRING,
	product_cputype STRING,
	product_current_generation STRING,
	product_database_engine STRING,
	product_dedicated_ebs_throughput STRING,
	product_deployment_option STRING,
	product_description STRING,
	product_durability STRING,
	product_ecu STRING,
	product_edition STRING,
	product_endpoint_type STRING,
	product_engine_code STRING,
	product_enhanced_networking_supported STRING,
	product_event_type STRING,
	product_fee_code STRING,
	product_fee_description STRING,
	product_finding_group STRING,
	product_finding_source STRING,
	product_finding_storage STRING,
	product_free_query_types STRING,
	product_from_location STRING,
	product_from_location_type STRING,
	product_gpu STRING,
	product_gpu_memory STRING,
	product_group STRING,
	product_group_description STRING,
	product_instance_family STRING,
	product_instance_type STRING,
	product_instance_type_family STRING,
	product_intel_avx2_available STRING,
	product_intel_avx_available STRING,
	product_intel_turbo_available STRING,
	product_io STRING,
	product_license_model STRING,
	product_location STRING,
	product_location_type STRING,
	product_max_iops_burst_performance STRING,
	product_max_iopsvolume STRING,
	product_max_throughputvolume STRING,
	product_max_volume_size STRING,
	product_maximum_extended_storage STRING,
	product_memory STRING,
	product_memory_gib STRING,
	product_memorytype STRING,
	product_message_delivery_frequency STRING,
	product_message_delivery_order STRING,
	product_min_volume_size STRING,
	product_network_performance STRING,
	product_normalization_size_factor STRING,
	product_operating_system STRING,
	product_operation STRING,
	product_origin STRING,
	product_parameter_type STRING,
	product_physical_cpu STRING,
	product_physical_gpu STRING,
	product_physical_processor STRING,
	product_pre_installed_sw STRING,
	product_processor_architecture STRING,
	product_processor_features STRING,
	product_product_family STRING,
	product_provisioned STRING,
	product_queue_type STRING,
	product_recipient STRING,
	product_region STRING,
	product_request_description STRING,
	product_request_type STRING,
	product_resource_endpoint STRING,
	product_routing_target STRING,
	product_routing_type STRING,
	product_servicecode STRING,
	product_servicename STRING,
	product_sku STRING,
	product_software_type STRING,
	product_standard_group STRING,
	product_standard_source STRING,
	product_standard_storage STRING,
	product_standard_storage_retention_included STRING,
	product_storage STRING,
	product_storage_class STRING,
	product_storage_media STRING,
	product_storage_type STRING,
	product_subscription_type STRING,
	product_tenancy STRING,
	product_throughput STRING,
	product_tiertype STRING,
	product_to_location STRING,
	product_to_location_type STRING,
	product_transfer_type STRING,
	product_usage_family STRING,
	product_usagetype STRING,
	product_vcpu STRING,
	product_version STRING,
	product_volume_api_name STRING,
	product_volume_type STRING,
	pricing_lease_contract_length STRING,
	pricing_offering_class STRING,
	pricing_purchase_option STRING,
	pricing_rate_id STRING,
	pricing_public_on_demand_cost DOUBLE,
	pricing_public_on_demand_rate STRING,
	pricing_term STRING,
	pricing_unit STRING,
	reservation_amortized_upfront_cost_for_usage DOUBLE,
	reservation_amortized_upfront_fee_for_billing_period DOUBLE,
	reservation_availability_zone STRING,
	reservation_effective_cost DOUBLE,
	reservation_end_time STRING,
	reservation_modification_status STRING,
	reservation_net_amortized_upfront_cost_for_usage DOUBLE,
	reservation_net_amortized_upfront_fee_for_billing_period DOUBLE,
	reservation_net_effective_cost DOUBLE,
	reservation_net_recurring_fee_for_usage DOUBLE,
	reservation_net_unused_amortized_upfront_fee_for_billing_period DOUBLE,
	reservation_net_unused_recurring_fee DOUBLE,
	reservation_net_upfront_value DOUBLE,
	reservation_normalized_units_per_reservation STRING,
	reservation_number_of_reservations STRING,
	reservation_recurring_fee_for_usage DOUBLE,
	reservation_reservation_a_r_n STRING,
	reservation_start_time STRING,
	reservation_subscription_id STRING,
	reservation_total_reserved_normalized_units STRING,
	reservation_total_reserved_units STRING,
	reservation_units_per_reservation STRING,
	reservation_unused_amortized_upfront_fee_for_billing_period DOUBLE,
	reservation_unused_normalized_unit_quantity DOUBLE,
	reservation_unused_quantity DOUBLE,
	reservation_unused_recurring_fee DOUBLE,
	reservation_upfront_value DOUBLE,
	discount_edp_discount DOUBLE,
	discount_total_discount DOUBLE,
	savings_plan_total_commitment_to_date DOUBLE,
	savings_plan_savings_plan_a_r_n STRING,
	savings_plan_savings_plan_rate DOUBLE,
	savings_plan_used_commitment DOUBLE,
	savings_plan_savings_plan_effective_cost DOUBLE,
	savings_plan_amortized_upfront_commitment_for_billing_period DOUBLE,
	savings_plan_recurring_commitment_for_billing_period DOUBLE,
	savings_plan_net_savings_plan_effective_cost DOUBLE,
	savings_plan_net_amortized_upfront_commitment_for_billing_period DOUBLE,
	savings_plan_net_recurring_commitment_for_billing_period DOUBLE,
	resource_tags_aws_created_by STRING,
	resource_tags_aws_ecs_service_name STRING,
	resource_tags_user_mup_cluster STRING,
	resource_tags_user_mup_owner STRING,
	resource_tags_user_mup_product_name STRING,
	resource_tags_user_mup_stage STRING,
	resource_tags_user_mup_type STRING,
	resource_tags_user_product_name STRING
)
PARTITIONED BY (
	year STRING,
	month STRING
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
WITH  SERDEPROPERTIES (
 'serialization.format' = '1'
) LOCATION 's3://cost-and-usage-report-bucket/hourly-report/cur-report/cur-report/'
@chenrui333

This comment has been minimized.

Copy link
Author

chenrui333 commented Jan 4, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.