Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-35198][CONNECT][CORE][PYTHON][SQL] Add support for calling debugCodegen from Python & Java #40608

Closed
wants to merge 7 commits into from

Conversation

juanvisoler
Copy link

@juanvisoler juanvisoler commented Mar 30, 2023

Add support for calling debugCodegen from Python & Java

What changes were proposed in this pull request?

  • Adds debugCodegen to the Dataset APIs core and connector
  • Adds debugCodegen to the pyspark dataframe API
  • Removes the implicit debugCodegen from sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala as it is public now.

Why are the changes needed?

To add a direct method to get debugCodegen state for Java & Python users of Dataframes.

Does this PR introduce any user-facing change?

debugCodegen is now accessible from all Scala, python and Java APIs. See usage below.

How was this patch tested?

Added tests in:

  • sql/core/src/test/scala/org/apache/spark/sql/DebugCodegenSuite.scala.
  • connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala

Local testing:

scala> spark.sql("SELECT 1").debugCodegen
Found 1 WholeStageCodegen subtrees.
== Subtree 1 / 1 (maxMethodCodeSize:55; maxConstantPoolSize:99(0.15% used); numInnerClasses:0) ==
*(1) Project [1 AS 1#0]
+- *(1) Scan OneRowRelation[]
...
>>> spark.sql("select 1").debugCodegen()
Found 1 WholeStageCodegen subtrees.
== Subtree 1 / 1 (maxMethodCodeSize:55; maxConstantPoolSize:99(0.15% used); numInnerClasses:0) ==
*(1) Project [1 AS 1#0]
+- *(1) Scan OneRowRelation[]
...

Add support for calling debugCodegen from Python & Java
@juanvisoler juanvisoler changed the title SPARK-35198 [SPARK-35198][CORE][PYTHON][SQL] Add support for calling debugCodegen from Python & Java Mar 30, 2023
@juanvisoler
Copy link
Author

@holdenk @MaxGekk

@arturobernalg
Copy link
Member

LGTM +1

Add support for calling debugCodegen from Python & Java - versionadded:: 3.5.0
Add support for calling debugCodegen from Python & Java - exclude debugCodegen() method from MiMaCompatibility
@juanvisoler juanvisoler changed the title [SPARK-35198][CORE][PYTHON][SQL] Add support for calling debugCodegen from Python & Java [SPARK-35198][CONNECT][CORE][PYTHON][SQL] Add support for calling debugCodegen from Python & Java Apr 1, 2023
@juanvisoler
Copy link
Author

@HyukjinKwon Changed the implementation to df.explain("codegen") and added it to the connector

@juanvisoler
Copy link
Author

Hi @HyukjinKwon Does the PR approach make sense to you?

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jul 20, 2023
@juanvisoler
Copy link
Author

Hey @HyukjinKwon @MaxGekk @holdenk, I created this PR a while ago... I would appreciate if you have the chance to review it.
Thanks!

@github-actions github-actions bot closed this Jul 21, 2023
@holdenk holdenk reopened this Aug 7, 2023
@github-actions github-actions bot removed the CORE label Aug 7, 2023
@holdenk
Copy link
Contributor

holdenk commented Aug 7, 2023

LGTM for 4.0, can you update the version tags and then we'll merge to the dev branch?

@github-actions github-actions bot closed this Aug 8, 2023
@juanvisoler
Copy link
Author

juanvisoler commented Aug 8, 2023

LGTM for 4.0, can you update the version tags and then we'll merge to the dev branch?

Thanks @holdenk. Updated the version tags to 4.0.0 but the bot closed the PR first. It should show up when you reopen the PR.

@arturobernalg
Copy link
Member

LGTM for 4.0, can you update the version tags and then we'll merge to the dev branch?

Thanks @holdenk. Updated the version tags to 4.0.0 but the bot closed the PR first. It should show up when you reopen the PR.

LGTM

@holdenk holdenk reopened this Aug 24, 2023
@github-actions github-actions bot closed this Aug 25, 2023
@holdenk holdenk reopened this Aug 25, 2023
@holdenk holdenk removed the Stale label Aug 25, 2023
Copy link

github-actions bot commented Dec 4, 2023

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Dec 4, 2023
@github-actions github-actions bot closed this Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants