pub struct ODPSImporter { /* private fields */ }Expand description
ODPS importer for parsing ODPS YAML files
Implementations§
Source§impl ODPSImporter
impl ODPSImporter
Sourcepub fn new() -> ODPSImporter
pub fn new() -> ODPSImporter
Create a new ODPS importer instance
Sourcepub fn with_table_ids(table_ids: Vec<String>) -> ODPSImporter
pub fn with_table_ids(table_ids: Vec<String>) -> ODPSImporter
Create a new ODPS importer with known table IDs for contractId validation
Sourcepub fn import(&self, yaml_content: &str) -> Result<ODPSDataProduct, ImportError>
pub fn import(&self, yaml_content: &str) -> Result<ODPSDataProduct, ImportError>
Import ODPS YAML content and create ODPSDataProduct
§Arguments
yaml_content- ODPS YAML content as a string
§Returns
A ODPSDataProduct parsed from the YAML content
§Example
use data_modelling_core::import::odps::ODPSImporter;
let importer = ODPSImporter::new();
let yaml = r#"
apiVersion: v1.0.0
kind: DataProduct
id: 550e8400-e29b-41d4-a716-446655440000
name: customer-data-product
version: 1.0.0
status: active
"#;
let product = importer.import(yaml).unwrap();
assert_eq!(product.name, Some("customer-data-product".to_string()));Trait Implementations§
Source§impl Default for ODPSImporter
impl Default for ODPSImporter
Source§fn default() -> ODPSImporter
fn default() -> ODPSImporter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ODPSImporter
impl RefUnwindSafe for ODPSImporter
impl Send for ODPSImporter
impl Sync for ODPSImporter
impl Unpin for ODPSImporter
impl UnwindSafe for ODPSImporter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more