Skip to content

Instantly share code, notes, and snippets.

@DGrady
DGrady / flatten_spark_schema.py
Last active October 16, 2019 16:00
Flatten a Spark DataFrame schema
"""
The schemas that Spark produces for DataFrames are typically
nested, and these nested schemas are quite difficult to work with
interactively. In many cases, it's possible to flatten a schema
into a single level of column names.
"""
import typing as T
import cytoolz.curried as tz
# -*- coding: utf-8 -*-
import Tkinter
import random
import copy
import hashlib
import cx_Oracle
__author__ = 'Alex'