Skip to main content

Recursively flatten complex PySpark DataFrames with nested structs and arrays

Project description

spark-json-flatten

A lightweight utility to recursively flatten complex PySpark DataFrames containing deeply nested structs and arrays.

Features

  • Recursive schema flattening
  • Handles arbitrary nesting depth
  • Uses explode_outer for safe array expansion
  • No UDFs, fully Spark-native

Installation

pip install spark-json-flatten

from spark_json_flatten import flatten_recursive

flattened_df = flatten_recursive(complex_df)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spark_json_flatten-0.1.1.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spark_json_flatten-0.1.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file spark_json_flatten-0.1.1.tar.gz.

File metadata

  • Download URL: spark_json_flatten-0.1.1.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for spark_json_flatten-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b0266e7d16d0ee03e8382e7739c26851d21d6627c0883adebe8c5b2c99833a05
MD5 452458489532437374d171cc47455d76
BLAKE2b-256 67436adead33333600a7694abdaac59c6239973fa74137645dfd78a47a0bd791

See more details on using hashes here.

File details

Details for the file spark_json_flatten-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for spark_json_flatten-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1b1cede007f8cb44b3839ad8c78a762c872bdf5346efb9b346a3751d5c0caa47
MD5 05d75d27c115dbe59a805d3ab6cc2fa9
BLAKE2b-256 ccbcba37fd661ea9acf4ca8562d3ed47305b379b6d9fbc245ac637192652ba57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page