Module odcs_shared

Module odcs_shared 

Source
Expand description

Shared utilities for ODCS and ODCL parsing.

This module contains common types, utility functions, and parsing helpers used by both the ODCS (Open Data Contract Standard) and ODCL (legacy Data Contract) importers. Separating these shared components allows for cleaner code organization and easier testing.

Structs§

ParserError
Parser error structure for detailed error reporting.

Functions§

column_to_column_data
Convert a Column to ColumnData, preserving all ODCS v3.1.0 fields. This is used when importers create Column objects internally and need to return ColumnData in the ImportResult.
expand_nested_column
Expand a nested column from a schema definition, creating columns with dot notation.
extract_catalog_schema
Extract catalog and schema from customProperties.
extract_metadata_from_custom_properties
Extract metadata from customProperties in ODCS/ODCL format.
extract_quality_from_obj
Extract quality rules from a JSON object.
extract_shared_domains
Extract sharedDomains from customProperties.
json_value_to_serde_value
Convert JSON Value to serde_json::Value for storage in HashMap.
normalize_data_type
Normalize data type to uppercase, preserving STRUCT<…>, ARRAY<…>, MAP<…> format.
parse_data_vault_classification
Parse Data Vault classification from string.
parse_field_definition
Parse a single field definition (e.g., “ID: STRING” or “DETAILS: STRUCT<…>”).
parse_foreign_key
Parse foreign key from JSON value.
parse_foreign_key_from_data_contract
Parse foreign key from Data Contract field data.
parse_medallion_layer
Parse medallion layer from string.
parse_scd_pattern
Parse SCD pattern from string.
parse_struct_fields_from_string
Parse STRUCT fields from string (e.g., “ID: STRING, NAME: STRING”).
resolve_ref
Resolve a $ref reference like ‘#/definitions/orderAction’.
yaml_to_json_value
Convert YAML Value to JSON Value for easier manipulation.