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

[parquet-sdk]migrate objects [pt2] #641

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

yuunlimm
Copy link
Contributor

@yuunlimm yuunlimm commented Dec 11, 2024

Description

  • migrate objects
  • for parquet, we want to avoid lookups for deleted resource. so we replaced with default values, which will be handled during the load as a part of qc pipeline.
                 Self {
                        transaction_version: txn_version,
                        write_set_change_index,
                        object_address: resource.address.clone(),
                        owner_address: DELETED_RESOURCE_OWNER_ADDRESS.to_string(),   <-------
                        state_key_hash: resource.state_key_hash.clone(),
                        guid_creation_num: BigDecimal::default(),       <-------
                        allow_ungated_transfer: false,     <-------
                        is_deleted: true,
                        untransferrable: false,          <-------
                        block_timestamp: chrono::NaiveDateTime::default(),      <-------

these fields are the ones from the prev owner

Test Plan

  • Compared the number of rows from DE teams BigQuery table, testing BigQuery table, legacy processor table, and sdk processor table

objects

Screenshot 2024-12-11 at 9 57 15 PM
Screenshot 2024-12-11 at 10 02 36 PM

current objects

Screenshot 2024-12-11 at 9 57 26 PM
Screenshot 2024-12-11 at 10 05 24 PM

Copy link
Contributor Author

yuunlimm commented Dec 11, 2024

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 40.09324% with 257 lines in your changes missing coverage. Please review.

Project coverage is 48.0%. Comparing base (fdfb3a3) to head (a0c8208).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rc/parquet_processors/parquet_objects_processor.rs 0.0% 100 Missing ⚠️
.../src/db/parquet/models/object_models/v2_objects.rs 0.0% 43 Missing ⚠️
...uet_objects_processor/parquet_objects_extractor.rs 0.0% 37 Missing ⚠️
...c/db/common/models/object_models/raw_v2_objects.rs 58.1% 31 Missing ⚠️
rust/processor/src/processors/objects_processor.rs 85.9% 16 Missing ⚠️
rust/sdk-processor/src/parquet_processors/mod.rs 0.0% 8 Missing ⚠️
...ust/processor/src/processors/token_v2_processor.rs 50.0% 7 Missing ⚠️
.../models/token_v2_models/raw_v2_token_ownerships.rs 40.0% 6 Missing ⚠️
...s/parquet_processors/parquet_token_v2_processor.rs 0.0% 3 Missing ⚠️
...k-processor/src/config/indexer_processor_config.rs 0.0% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #641     +/-   ##
=======================================
+ Coverage   46.6%   48.0%   +1.3%     
=======================================
  Files        229     232      +3     
  Lines      27015   27159    +144     
=======================================
+ Hits       12616   13055    +439     
+ Misses     14399   14104    -295     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from 5d38eb5 to 70d8577 Compare December 11, 2024 21:03
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 4ba014f to 17380f2 Compare December 11, 2024 21:03
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from 70d8577 to 9ba9c5b Compare December 11, 2024 21:08
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 17380f2 to 09bbf57 Compare December 11, 2024 21:08
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from 9ba9c5b to d696fa3 Compare December 11, 2024 22:18
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 09bbf57 to 5ac554a Compare December 11, 2024 22:19
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from d696fa3 to 5cdcf00 Compare December 11, 2024 23:43
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 5ac554a to 461e8e2 Compare December 11, 2024 23:43
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from 5cdcf00 to 6466470 Compare December 11, 2024 23:54
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 461e8e2 to 5d72b43 Compare December 11, 2024 23:54
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from 6466470 to 055afb7 Compare December 12, 2024 02:23
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 5d72b43 to 50c3256 Compare December 12, 2024 02:24
@yuunlimm yuunlimm marked this pull request as ready for review December 12, 2024 03:29
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from 055afb7 to fb86376 Compare December 12, 2024 03:32
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 50c3256 to e17ef44 Compare December 12, 2024 03:32
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from fb86376 to dd3d690 Compare December 12, 2024 03:47
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch 2 times, most recently from 416d2a1 to c57057f Compare December 12, 2024 05:50
@yuunlimm yuunlimm requested a review from dermanyang December 12, 2024 06:11
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from dd3d690 to e715374 Compare December 16, 2024 16:50
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from c57057f to d37f9ec Compare December 16, 2024 16:50
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from e715374 to 427bb32 Compare December 16, 2024 17:05
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from d37f9ec to b28c1bd Compare December 16, 2024 17:13
@@ -126,7 +128,7 @@ impl RawObject {
txn_version: i64,
write_set_change_index: i64,
object_mapping: &AHashMap<CurrentObjectPK, RawCurrentObject>,
conn: &mut DbPoolConnection<'_>,
conn: &mut Option<DbPoolConnection<'_>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Spoke offline; we thought it doesn't make sense to have a required query_retries and q_retry_delay when the client isn't present. At the same time, having all as option could lead to some user error. Agreed on introducing a new struct DbConnection as an Optional parameter with all three fields as required.

@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch from 427bb32 to a54e4d5 Compare December 16, 2024 20:28
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from b28c1bd to 4ddadba Compare December 16, 2024 20:28
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt1_ branch 2 times, most recently from a906016 to bd8a1ca Compare December 16, 2024 21:33
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 4ddadba to e837cca Compare December 16, 2024 21:33
@yuunlimm yuunlimm changed the base branch from 12-11-_parquet-sdk_migrate_objects_pt1_ to graphite-base/641 December 16, 2024 22:18
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from e837cca to 20a4696 Compare December 16, 2024 22:20
@yuunlimm yuunlimm changed the base branch from graphite-base/641 to main December 16, 2024 22:21
@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch 2 times, most recently from 5dfd840 to 2eebae8 Compare December 17, 2024 23:06
if db_context.is_none() {
// This is a hack to prevent the program for parquet
Ok(Some((
Self {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yuunlimm yuunlimm force-pushed the 12-11-_parquet-sdk_migrate_objects_pt2_ branch from 2eebae8 to a0c8208 Compare December 18, 2024 22:08
@@ -284,3 +284,9 @@ where
Ok(())
}
}

pub struct DbContext<'a> {
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥

@yuunlimm yuunlimm merged commit 0cad206 into main Dec 18, 2024
11 checks passed
@yuunlimm yuunlimm deleted the 12-11-_parquet-sdk_migrate_objects_pt2_ branch December 18, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants