Restore SQL from Spark Project logical plan JSON
Project description
spark-project-sql-restore
Standalone Python package that restores SQL text from Spark logical plan JSON
containing org.apache.spark.sql.catalyst.plans.logical.Project.
Install
pip install spark-project-sql-restore
Usage
from spark_project_sql_restore import project_json_to_sql
plan_json = """
{
"class": "org.apache.spark.sql.catalyst.plans.logical.Project",
"projectList": [
{
"class": "org.apache.spark.sql.catalyst.expressions.Alias",
"name": "a",
"child": {
"class": "org.apache.spark.sql.catalyst.expressions.Literal",
"value": 1,
"dataType": "integer"
}
}
],
"child": {"class": "org.apache.spark.sql.catalyst.plans.logical.OneRowRelation"}
}
"""
sql = project_json_to_sql(plan_json)
print(sql)
# SELECT 1 AS a FROM (SELECT 1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spark_project_sql_restore-0.1.0.tar.gz.
File metadata
- Download URL: spark_project_sql_restore-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4425bd3f964f7c77f1246b7c7bbe364b5c4bb1ad215fc945cb4c62c608b669e
|
|
| MD5 |
380d2a6ab682703402d4b596ccac1162
|
|
| BLAKE2b-256 |
a72ac51caac69efcbf3ccdbc4209664c2a93a1bbb9b2b9d0b103c04e794ff74e
|
File details
Details for the file spark_project_sql_restore-0.1.0-py3-none-any.whl.
File metadata
- Download URL: spark_project_sql_restore-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f103be85ba0a440fd0193212b4c0d835ca574e859b09e84935b6c64371f84a40
|
|
| MD5 |
cb6996bdb73619880f07aa17be5e9e08
|
|
| BLAKE2b-256 |
b7f46acfa9e675a47e0d2865977ea84433fa1e20b2699c83a092775ce9ba4e39
|