This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import typing as T | |
import cytoolz.curried as tz | |
import pyspark | |
from pyspark.sql.functions import explode_outer | |
from pyspark.sql.types import BooleanType | |
def schema_to_columns(schema: pyspark.sql.types.StructType) -> T.List[T.List[str]]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark.sql.types import * | |
from pyspark.sql.functions import * | |
def flatten_test(df, sep="_"): | |
"""Returns a flattened dataframe. | |
.. versionadded:: x.X.X | |
Parameters | |
---------- |