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

refactor parquet extractor backfill support function #613

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,7 @@
];

// Populate the map based on opt-in tables
for (table_flag, enum_type, data) in data_types {
add_to_map_if_opted_in_for_backfill(
self.opt_in_tables,
&mut map,
table_flag,
enum_type,
data,
);
}
add_to_map_if_opted_in_for_backfill(self.opt_in_tables, &mut map, data_types.to_vec());

Check warning on line 102 in rust/sdk-processor/src/steps/parquet_default_processor/parquet_default_extractor.rs

View check run for this annotation

Codecov / codecov/patch

rust/sdk-processor/src/steps/parquet_default_processor/parquet_default_extractor.rs#L102

Added line #L102 was not covered by tests

Ok(Some(TransactionContext {
data: map,
Expand Down
11 changes: 5 additions & 6 deletions rust/sdk-processor/src/utils/parquet_extractor_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
pub fn add_to_map_if_opted_in_for_backfill(
opt_in_tables: TableFlags,
map: &mut HashMap<ParquetTypeEnum, ParquetTypeStructs>,
table_flag: TableFlags,
enum_type: ParquetTypeEnum,
data: ParquetTypeStructs,
data_types: Vec<(TableFlags, ParquetTypeEnum, ParquetTypeStructs)>,

Check warning on line 9 in rust/sdk-processor/src/utils/parquet_extractor_helper.rs

View check run for this annotation

Codecov / codecov/patch

rust/sdk-processor/src/utils/parquet_extractor_helper.rs#L9

Added line #L9 was not covered by tests
) {
// Add to map if all tables are opted-in (empty) or if the specific flag is set
if opt_in_tables.is_empty() || opt_in_tables.contains(table_flag) {
map.insert(enum_type, data);
for (table_flag, enum_type, data) in data_types {
if opt_in_tables.is_empty() || opt_in_tables.contains(table_flag) {
map.insert(enum_type, data);
}

Check warning on line 14 in rust/sdk-processor/src/utils/parquet_extractor_helper.rs

View check run for this annotation

Codecov / codecov/patch

rust/sdk-processor/src/utils/parquet_extractor_helper.rs#L11-L14

Added lines #L11 - L14 were not covered by tests
}
}
Loading