Skip to content

Commit

Permalink
Merge pull request #866 from eiffel777/change-staging-table-coalesce-…
Browse files Browse the repository at this point in the history
…to-1

Change staging table to use 1 as unknown id instead of -1
  • Loading branch information
Greg Dean authored Mar 22, 2019
2 parents 3f793d1 + ea5d83b commit 9cef334
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"source_query": {
"records": {
"resource_id": "raw.resource_id",
"account_id": "COALESCE(act.account_id, -1)",
"account_id": "COALESCE(act.account_id, 1)",
"provider_identifier": "COALESCE(raw.provider_instance_identifier, 'unknown')"
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"record_type_id": "COALESCE(rtype.record_type_id, -1)",
"user_name": "rv.provider_user",
"person_id": "sa.person_id",
"account_id": "COALESCE(acct.account_id, -1)",
"host_id": "COALESCE(h.host_id, -1)",
"instance_id": "COALESCE(i.instance_id, -1)",
"instance_type_id": "COALESCE(itype.instance_type_id, -1)",
"image_id": "COALESCE(img.image_id, -1)",
"account_id": "COALESCE(acct.account_id, 1)",
"host_id": "COALESCE(h.host_id, 1)",
"instance_id": "COALESCE(i.instance_id, 1)",
"instance_type_id": "COALESCE(itype.instance_type_id, 1)",
"image_id": "COALESCE(img.image_id, 1)",
"event_data": "raw.event_data",
"root_volume_type_id": "COALESCE(atype.asset_type_id, -1)"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"source_query": {
"records": {
"resource_id": "raw.resource_id",
"account_id": "COALESCE(act.account_id, -1)",
"account_id": "COALESCE(act.account_id, 1)",
"provider_identifier": "COALESCE(raw.provider_instance_identifier, 'unknown')"
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"record_type_id": "COALESCE(rtype.record_type_id, -1)",
"user_name": "raw.user_name",
"person_id": "sa.person_id",
"account_id": "COALESCE(acct.account_id, -1)",
"host_id": "COALESCE(h.host_id, -1)",
"instance_id": "COALESCE(i.instance_id, -1)",
"image_id": "COALESCE(img.image_id, -1)",
"instance_type_id": "COALESCE(itype.instance_type_id, -1)",
"account_id": "COALESCE(acct.account_id, 1)",
"host_id": "COALESCE(h.host_id, 1)",
"instance_id": "COALESCE(i.instance_id, 1)",
"image_id": "COALESCE(img.image_id, 1)",
"instance_type_id": "COALESCE(itype.instance_type_id, 1)",
"event_data": "raw.event_data",
"volume_id": "raw.volume_id"
},
Expand Down
2 changes: 1 addition & 1 deletion configuration/etl/etl_tables.d/cloud_common/account.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "int(11)",
"nullable": false,
"extra": "auto_increment",
"comment": "Unknown = -1"
"comment": "Unknown = 1"
},
{
"name": "provider_account",
Expand Down
6 changes: 3 additions & 3 deletions configuration/etl/etl_tables.d/cloud_common/instance.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"type": "int(11)",
"nullable": false,
"extra": "auto_increment",
"comment": "Auto-increment relative to resource_id. Unknown = -1"
"comment": "Auto-increment relative to resource_id. Unknown = 1"
},
{
"name": "account_id",
"type": "int(11)",
"nullable": false,
"default": 1,
"comment": "Unknown = -1"
"comment": "Unknown = 1"
},
{
"name": "provider_identifier",
Expand All @@ -35,7 +35,7 @@
"name": "person_id",
"type": "int(11)",
"nullable": false,
"default": 1,
"default": -1,
"comment": "Unknown = -1"
}
],
Expand Down
20 changes: 10 additions & 10 deletions configuration/etl/etl_tables.d/cloud_generic/staging_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"name": "instance_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Optional instance the event is associated with. Unknown = -1"
"default": 1,
"comment": "Optional instance the event is associated with. Unknown = 1"
},
{
"name": "event_time_ts",
Expand Down Expand Up @@ -55,29 +55,29 @@
"name": "account_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Optional account the event is associated with. Unknown = -1"
"default": 1,
"comment": "Optional account the event is associated with. Unknown = 1"
},
{
"name": "host_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Host where the event occured. Unknown = -1"
"default": 1,
"comment": "Host where the event occured. Unknown = 1"
},
{
"name": "instance_type_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Instance type for the event. Unknown = -1"
"default": 1,
"comment": "Instance type for the event. Unknown = 1"
},
{
"name": "image_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Image associated with the event. Unknown = -1"
"default": 1,
"comment": "Image associated with the event. Unknown = 1"
},
{
"name": "event_data",
Expand Down
20 changes: 10 additions & 10 deletions configuration/etl/etl_tables.d/cloud_openstack/staging_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"name": "instance_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Optional instance the event is associated with. Unknown = -1"
"default": 1,
"comment": "Optional instance the event is associated with. Unknown = 1"
},
{
"name": "event_time_ts",
Expand Down Expand Up @@ -55,22 +55,22 @@
"name": "account_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Optional account the event is associated with. Unknown = -1"
"default": 1,
"comment": "Optional account the event is associated with. Unknown = 1"
},
{
"name": "host_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Host where the event occured. Unknown = -1"
"default": 1,
"comment": "Host where the event occured. Unknown = 1"
},
{
"name": "instance_type_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Instance type for the event. Unknown = -1"
"default": 1,
"comment": "Instance type for the event. Unknown = 1"
},
{
"name": "event_data",
Expand All @@ -90,8 +90,8 @@
"name": "image_id",
"type": "int(11)",
"nullable": false,
"default": -1,
"comment": "Image associated with the event. Unknown = -1"
"default": 1,
"comment": "Image associated with the event. Unknown = 1"
},
{
"name": "volume_id",
Expand Down

0 comments on commit 9cef334

Please sign in to comment.