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.0.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.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spark_json_flatten-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 6a721d8f3f1cdc669a530d852165b671d2a6b00f6bdbbef1367f4b9bf42c2311
MD5 e0d7e76bd01b135af56be91ba8a2125c
BLAKE2b-256 f4183e273a23f9beac11e75d976331d30b26d6dd129919461d4596a1b507dfd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spark_json_flatten-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bfa5b00632f1e6e18e57b6070d936e197581a8ae02760719b4b22948af30a873
MD5 2c0dd38bc95e2f801e583a9573b4ea4a
BLAKE2b-256 54d284df639daa99622e54ab897a03efd62cf5544809d4f3ae12c377372b3f05

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