forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49201][PS][PYTHON][CONNECT] Reimplement
hist
plot with Spark…
… SQL ### What changes were proposed in this pull request? Reimplement `hist` plot with Spark SQL ### Why are the changes needed? Reimplement `hist` plot with Spark SQL to support Spark Connect, since the `pyspark.ml.feature.Bucketizer` has not been supported with Spark Connect. ### Does this PR introduce _any_ user-facing change? yes, follow plotting functions are enabled in Spark Connect: - `{Frame, Series}.plot.hist` - `{Frame, Series}.plot(kind="hist", ...)` ### How was this patch tested? 1, enabled parity tests; 2, manually check with: ``` import pyspark.pandas as ps import pandas as pd import numpy as np np.random.seed(123) df = pd.DataFrame(np.random.randint(1, 7, 6000), columns=['one']) df['two'] = df['one'] + np.random.randint(1, 7, 6000) df = ps.from_pandas(df) df.plot.hist(bins=12, alpha=0.5) ``` before (Spark Classic):  after (Spark Connect):  ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#47708 from zhengruifeng/reimpl_hist. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
- Loading branch information
1 parent
1113029
commit 70b814b
Showing
6 changed files
with
29 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters