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

Change staging table to use 1 as unknown id instead of -1 #866

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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