[source-facebook-marketing] -> [BigQuery] MERGE query for streams made with custom insights configuration are only loading 1 record per account id
- Ngôn ngữ chính
- Python
- Star
- 22.1k
- Fork
- 5.3k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
### Connector Name
source-facebookmarketing
### Connector Version
2.1.7
### What step the error happened?
Other
### Relevant information
I have a custom insights stream configured like this:
Fields
- account_id
- account_name
- campaign_id
- campaign_name
- spend
- impressions
- clicks
- date_start
- date_stop
Level
- campaign
The connection insists that `ad_id` is a primary key for this custom insights configuration

Naturally in the destination table this field value is NULL

I've noticed that our data doesn't match up with the Excel extractions from the platform, the gap is very large.
It is clear from the MERGE query, that the culprit is the row numbering which occurs in a window that includes `date`, `account_id`, `ad_id` (NULL).
This causes the merge query to load only the 1st record extracted for each ad account, consequently including only 1 campaign.

We've verified that the destination table includes only 1 campaign per account, which does not reflect the marketing activity of these ad accounts.
I have tried refreshing source schema, but the `ad_id` persists in the custom insights report.
I haven't dug into the source code, so I can't tell why this happens, though I assume the custom insights `level` parameter should be enough to hint which fields can be used as primary key, and this is not respected.
### Relevant log output
_No response_
### Contribute
- [ ] Yes, I want to contribute
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.