Utils
This module provides utility functions while working with delta framework.
koheesio.spark.writers.delta.utils.log_clauses #
Prepare log message for clauses of DeltaMergePlan statement.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clauses |
JavaObject
|
The clauses of the DeltaMergePlan statement. |
required |
source_alias |
str
|
The source alias. |
required |
target_alias |
str
|
The target alias. |
required |
Returns:
Type | Description |
---|---|
Optional[str]
|
The log message if there are clauses, otherwise None. |
Notes
This function prepares a log message for the clauses of a DeltaMergePlan statement. It iterates over the clauses, processes the conditions, and constructs the log message based on the clause type and columns.
If the condition is a value, it replaces the source and target aliases in the condition string. If the condition is None, it sets the condition_clause to "No conditions required".
The log message includes the clauses type, the clause type, the columns, and the condition.