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

feat(warehouse): added duplicates stats for snowflake #3097

Merged
merged 6 commits into from
Mar 14, 2023

Conversation

achettyiitr
Copy link
Member

@achettyiitr achettyiitr commented Mar 14, 2023

Description

  • Added support for observability around loading tables for SNOWFLAKE.
  • Deepsource recommendations
    • use %q instead of "%s" for quoted strings

Notion Ticket

https://www.notion.so/rudderstacks/dedup-metrics-for-snowflake-2ff3ff988a9f4b01bd1815ecc70849e6?pvs=4

Security

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

Comment on lines +1194 to +1198
// Skip loading user tables if identifies table schema is not present
if identifiesSchema := job.GetTableSchemaInUpload(warehouseutils.IdentifiesTable); len(identifiesSchema) == 0 {
return []error{}, nil
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of keeping this check at the integration level, moving this out.

Comment on lines 547 to 548
WHEN MATCHED THEN
UPDATE SET original.received_at = original.received_at;
Copy link
Member Author

@achettyiitr achettyiitr Mar 14, 2023

Choose a reason for hiding this comment

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

Adding a dummy update block. We are just updating a dummy column with its original values, not the staging values.

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Patch coverage: 0.21% and project coverage change: -0.37 ⚠️

Comparison is base (ea3bbd5) 53.79% compared to head (9f05d56) 53.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3097      +/-   ##
==========================================
- Coverage   53.79%   53.42%   -0.37%     
==========================================
  Files         348      348              
  Lines       53846    54182     +336     
==========================================
- Hits        28965    28947      -18     
- Misses      23240    23592     +352     
- Partials     1641     1643       +2     
Impacted Files Coverage Δ
warehouse/upload.go 20.10% <0.00%> (-0.04%) ⬇️
warehouse/integrations/snowflake/snowflake.go 1.02% <0.21%> (-0.33%) ⬇️

... and 6 files with indirect coverage changes

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment on lines -331 to -336
if dbHandle == nil {
dbHandle, err = Connect(sf.getConnectionCredentials(optionalCreds{schemaName: sf.Namespace}))
if err != nil {
sf.Logger.Errorf("SF: Error establishing connection for copying table:%s: %v\n", tableName, err)
return
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, dbHandle is always set as nil. Removing this condition.

@achettyiitr achettyiitr merged commit 0eeaeb5 into master Mar 14, 2023
@achettyiitr achettyiitr deleted the feat.snowflake-load-updates branch March 14, 2023 14:49
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.

None yet

3 participants