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

fix(warehouse): id resolution index issue #2676

Merged
merged 3 commits into from
Nov 9, 2022

Conversation

achettyiitr
Copy link
Member

@achettyiitr achettyiitr commented Nov 9, 2022

Description

  1. Enable ID resolution during Warehouse Integration Tests.
  2. ID resolution index queries are not formatted properly.

Notion Ticket

https://www.notion.so/rudderstacks/ID-Resolution-fix-37b86edc58424110b6562afa4999176f

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@achettyiitr achettyiitr changed the title fix(warehouse): id resolution index fix(warehouse): id resolution index issue Nov 9, 2022
@achettyiitr achettyiitr marked this pull request as ready for review November 9, 2022 09:16
@codecov
Copy link

codecov bot commented Nov 9, 2022

Codecov Report

Base: 45.43% // Head: 45.43% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (81ed945) compared to base (ea8cf4c).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@              Coverage Diff               @@
##           release/1.3.x    #2676   +/-   ##
==============================================
  Coverage          45.43%   45.43%           
==============================================
  Files                287      287           
  Lines              47777    47790   +13     
==============================================
+ Hits               21707    21715    +8     
- Misses             24691    24698    +7     
+ Partials            1379     1377    -2     
Impacted Files Coverage Δ
warehouse/bigquery/bigquery.go 1.01% <0.00%> (-0.02%) ⬇️
warehouse/identities.go 1.04% <0.00%> (ø)
processor/processor.go 86.40% <0.00%> (+0.41%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -396,17 +396,31 @@ func (bq *HandleT) loadTable(tableName string, _, getLoadFileLocFromTableUploads
primaryJoinClause := strings.Join(primaryKeyList, " AND ")
bqTable := func(name string) string { return fmt.Sprintf("`%s`.`%s`", bq.namespace, name) }

var orderByClause string
if _, ok := tableColMap["received_at"]; ok {
orderByClause = "ORDER BY received_at DESC"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achettyiitr why it was a problem to always do ORDER BY received_at DESC?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When enabling ID resolution, we create 2 tables.

  1. rudder_identity_mappings (merge_property_type, merge_property_value)
  2. rudder_identity_merge_rules (merge_property_1_type, merge_property_1_value, merge_property_2_type, merge_property_2_value)

Copy link
Member Author

@achettyiitr achettyiitr Nov 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these don't contain received_at, it was failing there.

@achettyiitr achettyiitr merged commit 8ddfb8e into release/1.3.x Nov 9, 2022
This was referenced Nov 9, 2022
@achettyiitr achettyiitr deleted the fix.id-resolution branch November 11, 2022 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants