Common Helper, Functions, Logging and UDF Module Documentation

The common module provides generic helper functions to support a Delta Lakehouse implementation

Common Helpers

get_db_utils(spark)

Returns an instance of the DBUtils (pyspark.dbutils) object or the dbutils object (IPython), depending on the environment in which the Spark

function_name()

Returns the name of the calling function.

Log Analytics Logging

get_workspace_login_creds(spark)

Returns the log analytics workspace and log analytics secret for framework logging.

build_la_signature(workspace_id, ...)

Builds the Log Analytics signature used for authentication: string that is used to identify and secure requests to the Log Analytics API

post_la_data(spark, body, log_type)

Posts data to the Log Analytics API.

User Defined Functions

cdm_view_sql_conversion(input, view_name)

This function is used to convert data types and functions used in CDM data definitions to Data Lakehouse data types and methods

Helper Functions

main(spark, function, arg_params)

Main serves as an entry point allows caller to specify function to call and params for that function as JSON