-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1391 from eiffel777/cloud-convert-hypervisor-fact…
…s-local-tz Convert date for cloud resource specifications to correct timezone from UTC
- Loading branch information
Showing
8 changed files
with
96 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
configuration/etl/etl_action_defs.d/cloud_common/staging_resource_specifications.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"#": "@@session.time_zone is used instead of using the time zone listed in resources.json to keep consistency", | ||
"#": "with how time zone conversion works for other places in the cloud realm", | ||
"table_definition": { | ||
"$ref": "${table_definition_dir}/cloud_common/staging_resource_specifications.json#/table_definition" | ||
}, | ||
"source_query": { | ||
"records": { | ||
"resource_id": "raw.resource_id", | ||
"hostname": "raw.hostname", | ||
"vcpus": "raw.vcpus", | ||
"memory_mb": "raw.memory_mb", | ||
"fact_date": "DATE(CONVERT_TZ(raw.fact_date, '+00:00', @@session.time_zone))" | ||
}, | ||
"joins": [{ | ||
"name": "raw_resource_specs", | ||
"schema": "${SOURCE_SCHEMA}", | ||
"alias": "raw" | ||
}] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
}, | ||
{ | ||
"name": "fact_date", | ||
"type": "date", | ||
"type": "datetime", | ||
"nullable": false | ||
} | ||
], | ||
|
53 changes: 53 additions & 0 deletions
53
configuration/etl/etl_tables.d/cloud_common/staging_resource_specifications.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"#": "Record types are global to all cloud resources", | ||
|
||
"table_definition": { | ||
"name": "staging_resource_specifications", | ||
"engine": "MyISAM", | ||
"comment": "Record type: accounting, administrative, derived, etc.", | ||
"columns": [ | ||
{ | ||
"name": "hostname", | ||
"type": "varchar(225)", | ||
"nullable": false | ||
}, | ||
{ | ||
"name": "resource_id", | ||
"type": "int(11)", | ||
"nullable": false, | ||
"comment": "Unknown = -1 for global dimensions" | ||
}, | ||
{ | ||
"name": "memory_mb", | ||
"type": "int(11)", | ||
"nullable": false, | ||
"comment": "Amount of memory available on the associated node." | ||
}, | ||
{ | ||
"name": "vcpus", | ||
"type": "int(5)", | ||
"nullable": false, | ||
"default": null, | ||
"comment": "Number of vcpus available on the associated node." | ||
}, | ||
{ | ||
"name": "fact_date", | ||
"type": "date", | ||
"nullable": false | ||
} | ||
], | ||
"indexes": [ | ||
{ | ||
"name": "PRIMARY", | ||
"columns": [ | ||
"resource_id", | ||
"hostname", | ||
"memory_mb", | ||
"vcpus", | ||
"fact_date" | ||
], | ||
"is_unique": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters