Skip to content

Debugging

Functions

NameDescription
get_distinct_value_from_df_columnsGet distinct values from specified DataFrame columns and optionally display their counts.

get_distinct_value_from_df_columnsfunction#

def get_distinct_value_from_df_columns(df: DataFrame, columns_names: list[str], display: bool = True) -> dict[str, list]

Get distinct values from specified DataFrame columns and optionally display their counts.

Parameters

NameTypeDefaultDescription
dfDataFramerequiredThe input Spark DataFrame.
columns_nameslist[str]requiredList of column names to process.
displayboolTrueWhether to display the counts of distinct values. Default is True.

Returns

dict[str, list]
dict[str, list]: A dictionary where keys are column names and values are lists of distinct values.