easyfabric.loaders.xml
load_xml_bronze
def load_xml_bronze(object_info: ObjectInfo,
table_config: TableConfig,
config_manager: ConfigManager = None) -> DataFrame
Load XML file into Bronze layer with support for nested XML structures
Arguments:
object_info- ObjectInfo containing the XML file path infotable_config- Table configuration objectconfig_manager- Configuration manager object
Returns:
DataFrame with columns renamed according to table_config
validate_xml_schema
def validate_xml_schema(xml_file_path: str,
expected_schema: StructType) -> bool
Validate that the XML file matches the expected schema
Arguments:
xml_file_path- Path to the XML fileexpected_schema- Expected schema as StructType
Returns:
bool- True if schema matches, False otherwise
parse_xml_file
def parse_xml_file(abfs_file_path: str)
Parse the current content of the file on the driver.
Copied over its abfss path to local disk, not opened through the lakehouseA place where you store both "raw" data (like files) and "organized" data (like tables). It combines the best of a File Cabinet and a Database. mount (which serves a replaced file from its cache) nor read through Spark (which puts the whole file in one row, too big beyond 2 GB).
get_nested_data
def get_nested_data(data_dict, path)
Follow path through the parsed XML; an empty element on the way holds no rows.