-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a raw table item struct to support both parquet and postgres with…
…out duplicating the parsing code
- Loading branch information
Showing
8 changed files
with
209 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 5 additions & 8 deletions
13
rust/sdk-processor/src/steps/common/parquet_extractor_helper.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
use crate::parquet_processors::{ParquetTypeEnum, ParquetTypeStructs}; | ||
use processor::worker::TableFlags; | ||
use std::collections::HashMap; | ||
|
||
/// Fill the map with data if the table is opted in for backfill-purpose | ||
pub fn add_to_map_if_opted_in_for_backfill( | ||
opt_in_tables: &Option<Vec<String>>, | ||
opt_in_tables: TableFlags, | ||
map: &mut HashMap<ParquetTypeEnum, ParquetTypeStructs>, | ||
table_flag: TableFlags, | ||
enum_type: ParquetTypeEnum, | ||
data: ParquetTypeStructs, | ||
) { | ||
if let Some(ref backfill_table) = opt_in_tables { | ||
let table_name = enum_type.to_string(); | ||
if backfill_table.contains(&table_name) { | ||
map.insert(enum_type, data); | ||
} | ||
} else { | ||
// If there's no opt-in table, include all data | ||
// 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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.