sparklineage 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sparklineage-0.1.0/LICENSE +21 -0
- sparklineage-0.1.0/PKG-INFO +75 -0
- sparklineage-0.1.0/README.md +56 -0
- sparklineage-0.1.0/pyproject.toml +27 -0
- sparklineage-0.1.0/setup.cfg +4 -0
- sparklineage-0.1.0/src/sparklineage/__init__.py +15 -0
- sparklineage-0.1.0/src/sparklineage/inspector.py +43 -0
- sparklineage-0.1.0/src/sparklineage.egg-info/PKG-INFO +75 -0
- sparklineage-0.1.0/src/sparklineage.egg-info/SOURCES.txt +9 -0
- sparklineage-0.1.0/src/sparklineage.egg-info/dependency_links.txt +1 -0
- sparklineage-0.1.0/src/sparklineage.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pavan Badempet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sparklineage
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A lightweight PySpark utility for execution plan analysis, broadcast join checks, and DataFrame transformation lineage.
|
|
5
|
+
Author-email: Pavan Badempet <pavan9b@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://pavanbadempet.github.io
|
|
7
|
+
Project-URL: Documentation, https://pavanbadempet.github.io/optimizing-spark-pipelines.html
|
|
8
|
+
Project-URL: Source, https://github.com/pavanbadempet/sparklineage
|
|
9
|
+
Project-URL: Author Profile, https://www.linkedin.com/in/pavanbadempet/
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Database
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# sparklineage
|
|
21
|
+
|
|
22
|
+
[](https://pypi.org/project/sparklineage/)
|
|
23
|
+
[](https://pavanbadempet.github.io)
|
|
24
|
+
[](LICENSE)
|
|
25
|
+
|
|
26
|
+
A lightweight Python library for inspecting **Apache Spark** and **PySpark** execution plans, identifying shuffle bottlenecks, and validating broadcast join opportunities.
|
|
27
|
+
|
|
28
|
+
Authored and maintained by **[Pavan Badempet](https://pavanbadempet.github.io)**.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## ⚡ Key Features
|
|
33
|
+
|
|
34
|
+
- **Execution Plan Analysis:** Automatically parses physical query plans to detect un-broadcasted joins and large shuffles.
|
|
35
|
+
- **Stage Metrics Summary:** Provides concise execution summaries to identify task skew.
|
|
36
|
+
- **Lakehouse Metadata Helpers:** Validates partition pushdowns for Delta Lake and Iceberg tables.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 📦 Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install sparklineage
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🚀 Quickstart
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from sparklineage import PlanInspector
|
|
52
|
+
|
|
53
|
+
# Initialize inspector with your Spark DataFrame
|
|
54
|
+
inspector = PlanInspector(my_pyspark_df)
|
|
55
|
+
|
|
56
|
+
# Check for un-broadcasted join candidates
|
|
57
|
+
inspector.check_broadcast_opportunities(threshold_mb=100)
|
|
58
|
+
|
|
59
|
+
# Print execution recommendations
|
|
60
|
+
inspector.summarize()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 👨💻 Author
|
|
66
|
+
|
|
67
|
+
**Pavan Badempet**
|
|
68
|
+
- 🌐 **Portfolio & Case Studies:** [https://pavanbadempet.github.io](https://pavanbadempet.github.io)
|
|
69
|
+
- 💼 **LinkedIn:** [https://www.linkedin.com/in/pavanbadempet/](https://www.linkedin.com/in/pavanbadempet/)
|
|
70
|
+
- 💻 **GitHub:** [https://github.com/pavanbadempet](https://github.com/pavanbadempet)
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 📄 License
|
|
75
|
+
MIT License. Copyright (c) 2026 Pavan Badempet.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# sparklineage
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/sparklineage/)
|
|
4
|
+
[](https://pavanbadempet.github.io)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
A lightweight Python library for inspecting **Apache Spark** and **PySpark** execution plans, identifying shuffle bottlenecks, and validating broadcast join opportunities.
|
|
8
|
+
|
|
9
|
+
Authored and maintained by **[Pavan Badempet](https://pavanbadempet.github.io)**.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## ⚡ Key Features
|
|
14
|
+
|
|
15
|
+
- **Execution Plan Analysis:** Automatically parses physical query plans to detect un-broadcasted joins and large shuffles.
|
|
16
|
+
- **Stage Metrics Summary:** Provides concise execution summaries to identify task skew.
|
|
17
|
+
- **Lakehouse Metadata Helpers:** Validates partition pushdowns for Delta Lake and Iceberg tables.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 📦 Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install sparklineage
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🚀 Quickstart
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from sparklineage import PlanInspector
|
|
33
|
+
|
|
34
|
+
# Initialize inspector with your Spark DataFrame
|
|
35
|
+
inspector = PlanInspector(my_pyspark_df)
|
|
36
|
+
|
|
37
|
+
# Check for un-broadcasted join candidates
|
|
38
|
+
inspector.check_broadcast_opportunities(threshold_mb=100)
|
|
39
|
+
|
|
40
|
+
# Print execution recommendations
|
|
41
|
+
inspector.summarize()
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 👨💻 Author
|
|
47
|
+
|
|
48
|
+
**Pavan Badempet**
|
|
49
|
+
- 🌐 **Portfolio & Case Studies:** [https://pavanbadempet.github.io](https://pavanbadempet.github.io)
|
|
50
|
+
- 💼 **LinkedIn:** [https://www.linkedin.com/in/pavanbadempet/](https://www.linkedin.com/in/pavanbadempet/)
|
|
51
|
+
- 💻 **GitHub:** [https://github.com/pavanbadempet](https://github.com/pavanbadempet)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 📄 License
|
|
56
|
+
MIT License. Copyright (c) 2026 Pavan Badempet.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sparklineage"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Pavan Badempet", email="pavan9b@gmail.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "A lightweight PySpark utility for execution plan analysis, broadcast join checks, and DataFrame transformation lineage."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.8"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Topic :: Database",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
20
|
+
]
|
|
21
|
+
dependencies = []
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
"Homepage" = "https://pavanbadempet.github.io"
|
|
25
|
+
"Documentation" = "https://pavanbadempet.github.io/optimizing-spark-pipelines.html"
|
|
26
|
+
"Source" = "https://github.com/pavanbadempet/sparklineage"
|
|
27
|
+
"Author Profile" = "https://www.linkedin.com/in/pavanbadempet/"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""
|
|
2
|
+
sparklineage
|
|
3
|
+
~~~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
Lightweight PySpark execution plan analysis and lineage inspection utilities.
|
|
6
|
+
Authored by Pavan Badempet <pavan9b@gmail.com>
|
|
7
|
+
https://pavanbadempet.github.io
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
__version__ = "0.1.0"
|
|
11
|
+
__author__ = "Pavan Badempet"
|
|
12
|
+
|
|
13
|
+
from .inspector import PlanInspector
|
|
14
|
+
|
|
15
|
+
__all__ = ["PlanInspector"]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PlanInspector module for analyzing PySpark query execution plans.
|
|
3
|
+
Authored by Pavan Badempet (https://pavanbadempet.github.io)
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from typing import Dict, Any, List
|
|
7
|
+
|
|
8
|
+
class PlanInspector:
|
|
9
|
+
"""
|
|
10
|
+
Utility to inspect Spark DataFrame execution plans and diagnose shuffle bottlenecks.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, df: Any = None):
|
|
14
|
+
self.df = df
|
|
15
|
+
self.recommendations: List[str] = []
|
|
16
|
+
|
|
17
|
+
def check_broadcast_opportunities(self, threshold_mb: int = 100) -> List[str]:
|
|
18
|
+
"""
|
|
19
|
+
Inspect physical plan to check if small dimension tables triggered SortMergeJoin instead of BroadcastHashJoin.
|
|
20
|
+
"""
|
|
21
|
+
if self.df is None:
|
|
22
|
+
return ["No active DataFrame bound to inspector."]
|
|
23
|
+
|
|
24
|
+
try:
|
|
25
|
+
plan_str = self.df._jdf.queryExecution().executedPlan().toString()
|
|
26
|
+
if "SortMergeJoin" in plan_str and "BroadcastHashJoin" not in plan_str:
|
|
27
|
+
self.recommendations.append(
|
|
28
|
+
f"Consider broadcasting dimension tables under {threshold_mb}MB to avoid SortMergeJoin shuffle."
|
|
29
|
+
)
|
|
30
|
+
except Exception as e:
|
|
31
|
+
self.recommendations.append(f"Plan inspection failed: {str(e)}")
|
|
32
|
+
|
|
33
|
+
return self.recommendations
|
|
34
|
+
|
|
35
|
+
def summarize(self) -> Dict[str, Any]:
|
|
36
|
+
"""
|
|
37
|
+
Returns an overview summary of diagnostic insights.
|
|
38
|
+
"""
|
|
39
|
+
return {
|
|
40
|
+
"author": "Pavan Badempet",
|
|
41
|
+
"documentation": "https://pavanbadempet.github.io/optimizing-spark-pipelines.html",
|
|
42
|
+
"recommendations": self.recommendations
|
|
43
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sparklineage
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A lightweight PySpark utility for execution plan analysis, broadcast join checks, and DataFrame transformation lineage.
|
|
5
|
+
Author-email: Pavan Badempet <pavan9b@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://pavanbadempet.github.io
|
|
7
|
+
Project-URL: Documentation, https://pavanbadempet.github.io/optimizing-spark-pipelines.html
|
|
8
|
+
Project-URL: Source, https://github.com/pavanbadempet/sparklineage
|
|
9
|
+
Project-URL: Author Profile, https://www.linkedin.com/in/pavanbadempet/
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Database
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# sparklineage
|
|
21
|
+
|
|
22
|
+
[](https://pypi.org/project/sparklineage/)
|
|
23
|
+
[](https://pavanbadempet.github.io)
|
|
24
|
+
[](LICENSE)
|
|
25
|
+
|
|
26
|
+
A lightweight Python library for inspecting **Apache Spark** and **PySpark** execution plans, identifying shuffle bottlenecks, and validating broadcast join opportunities.
|
|
27
|
+
|
|
28
|
+
Authored and maintained by **[Pavan Badempet](https://pavanbadempet.github.io)**.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## ⚡ Key Features
|
|
33
|
+
|
|
34
|
+
- **Execution Plan Analysis:** Automatically parses physical query plans to detect un-broadcasted joins and large shuffles.
|
|
35
|
+
- **Stage Metrics Summary:** Provides concise execution summaries to identify task skew.
|
|
36
|
+
- **Lakehouse Metadata Helpers:** Validates partition pushdowns for Delta Lake and Iceberg tables.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 📦 Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install sparklineage
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🚀 Quickstart
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from sparklineage import PlanInspector
|
|
52
|
+
|
|
53
|
+
# Initialize inspector with your Spark DataFrame
|
|
54
|
+
inspector = PlanInspector(my_pyspark_df)
|
|
55
|
+
|
|
56
|
+
# Check for un-broadcasted join candidates
|
|
57
|
+
inspector.check_broadcast_opportunities(threshold_mb=100)
|
|
58
|
+
|
|
59
|
+
# Print execution recommendations
|
|
60
|
+
inspector.summarize()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 👨💻 Author
|
|
66
|
+
|
|
67
|
+
**Pavan Badempet**
|
|
68
|
+
- 🌐 **Portfolio & Case Studies:** [https://pavanbadempet.github.io](https://pavanbadempet.github.io)
|
|
69
|
+
- 💼 **LinkedIn:** [https://www.linkedin.com/in/pavanbadempet/](https://www.linkedin.com/in/pavanbadempet/)
|
|
70
|
+
- 💻 **GitHub:** [https://github.com/pavanbadempet](https://github.com/pavanbadempet)
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 📄 License
|
|
75
|
+
MIT License. Copyright (c) 2026 Pavan Badempet.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/sparklineage/__init__.py
|
|
5
|
+
src/sparklineage/inspector.py
|
|
6
|
+
src/sparklineage.egg-info/PKG-INFO
|
|
7
|
+
src/sparklineage.egg-info/SOURCES.txt
|
|
8
|
+
src/sparklineage.egg-info/dependency_links.txt
|
|
9
|
+
src/sparklineage.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sparklineage
|