Sharon Lavie
11/26/2022, 8:18 PM{
"type": "RECORD",
"record": {
"stream": "campaigns",
"data": {
"campaignId": 1043888667,
"startTime": "2022-11-25",
"primary_key": "2a5ab6e9b247d79699392f1a6dd87150",
"metadata": {
"campaignId": 1043888667,
"campaignName": "TP_US_generic",
"deleted": false,
"campaignStatus": "ENABLED",
"app_appName": "Asana Rebel: Get in Shape",
"app_adamId": 1067860796,
"servingStatus": "RUNNING",
"servingStateReasons": null,
"countriesOrRegions": [
"US"
],
"modificationTime": "2022-05-02T14:25:17.001",
"totalBudget_amount": "100000",
"totalBudget_currency": "EUR",
"dailyBudget_amount": "250",
"dailyBudget_currency": "EUR",
"displayStatus": "RUNNING",
"supplySources": [
"APPSTORE_SEARCH_RESULTS"
],
"adChannelType": "SEARCH",
"orgId": 51370,
"billingEvent": "TAPS",
"countryOrRegion": "US"
},
"metrics": {
"impressions": 25,
"taps": 0,
"installs": 0,
"newDownloads": 0,
"redownloads": 0,
"latOnInstalls": 0,
"latOffInstalls": 0,
"ttr": 0,
"avgCPA_amount": "0",
"avgCPA_currency": "EUR",
"avgCPT_amount": "0",
"avgCPT_currency": "EUR",
"avgCPM_amount": "0",
"avgCPM_currency": "EUR",
"localSpend_amount": "0",
"localSpend_currency": "EUR",
"conversionRate": 0,
"date": "2022-11-25"
}
},
"emitted_at": 1669492309596
}
}
As you can see i have metadata and metrics as objects and they are mapped in the schema.
In the main table: campaigns there are not duplicates, but! in the 2 extra tables made for the 2 objects (metadata and metrics) there are duplicates
Could someone please give me a hint here and direct me to where there problem lies?
this is my schema:
{
"$schema": "<http://json-schema.org/draft-04/schema#>",
"type": "object",
"properties": {
"campaignId": {
"type": "integer"
},
"startTime": {
"type": "string"
},
"primary_key": {
"type": "string"
},
"metadata": {
"type": "object",
"properties": {
"campaignId": {
"type": "integer"
},
"campaignName": {
"type": "string"
},
"deleted": {
"type": "boolean"
},
"campaignStatus": {
"type": "string"
},
"app_appName": {
"type": "string"
},
"app_adamId": {
"type": "integer"
},
"servingStatus": {
"type": "string"
},
"servingStateReasons": {
"type": "null"
},
"countriesOrRegions": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"modificationTime": {
"type": "string"
},
"totalBudget_amount": {
"type": "string"
},
"totalBudget_currency": {
"type": "string"
},
"dailyBudget_amount": {
"type": "string"
},
"dailyBudget_currency": {
"type": "string"
},
"displayStatus": {
"type": "string"
},
"supplySources": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"adChannelType": {
"type": "string"
},
"orgId": {
"type": "integer"
},
"billingEvent": {
"type": "string"
},
"countryOrRegion": {
"type": "string"
}
}
},
"metrics": {
"type": "object",
"properties": {
"impressions": {
"type": "integer"
},
"taps": {
"type": "integer"
},
"installs": {
"type": "integer"
},
"newDownloads": {
"type": "integer"
},
"redownloads": {
"type": "integer"
},
"latOnInstalls": {
"type": "integer"
},
"latOffInstalls": {
"type": "integer"
},
"ttr": {
"type": "number"
},
"avgCPA_amount": {
"type": "string"
},
"avgCPA_currency": {
"type": "string"
},
"avgCPT_amount": {
"type": "string"
},
"avgCPT_currency": {
"type": "string"
},
"avgCPM_amount": {
"type": "string"
},
"avgCPM_currency": {
"type": "string"
},
"localSpend_amount": {
"type": "string"
},
"localSpend_currency": {
"type": "string"
},
"conversionRate": {
"type": "number"
},
"date": {
"type": "string"
}
}
}
}
}Sherif Nada
11/28/2022, 1:11 AMSharon Lavie
11/29/2022, 11:47 AMSherif Nada
11/29/2022, 4:02 PMEdward Gao (Airbyte)
11/29/2022, 4:07 PMSharon Lavie
11/30/2022, 8:43 PM