Skip to content

[SPARK-56661] Addressing review comments from PR #55768 - #56367

Closed
sven-weber-db wants to merge 1 commit into
apache:masterfrom
sven-weber-db:sven-weber_data/SPARK-56661
Closed

[SPARK-56661] Addressing review comments from PR #55768#56367
sven-weber-db wants to merge 1 commit into
apache:masterfrom
sven-weber-db:sven-weber_data/SPARK-56661

Conversation

@sven-weber-db

@sven-weber-dbsven-weber-db commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This change addresses the open review comments from pull request #55768. In summary, the following changes were made:

Correctness fixes (2)

  1. SparkEnv.scala:161 — The created UDFDispatcherManager is now stored back into udfDispatcherManager =
    Some(created), so the cache works and stop() properly closes dispatchers.
  2. ExternalUDFPlanner.scala + logical/physical nodes + strategy — profile: Option[ResourceProfile] is now
    threaded through MapPartitionsExternalUDF (logical), MapPartitionsExternalUDFExec (physical),
    SparkStrategies, and UnifiedExternalUDFPlanner, so a ResourceProfile passed to mapInPandas is no longer
    silently dropped.

Nits (5)

  1. ExternalUDFExec.scala:65 — Reworded "CAN but MUST NOT cancel or close" → "may use the session but MUST
    NOT cancel or close it"
  2. MapPartitionsExternalUDFExec.scala:39-42 — Fixed stale Scaladoc: functionExpr → function, removed
    non-existent resultAttributes
  3. UDFDispatcherManager.scala:33 — [[stop]] → [[close]]
  4. UDFDispatcherManager.scala:49 — "write lock is used by stop" → "close"
  5. UDFDispatcherManager.scala:66 — Removed duplicate "quick path" comment

Why are the changes needed?

They were requested in a review of the above linked PR.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Linting & re-running existing tests. Mostly nit changes.

Was this patch authored or co-authored using generative AI tooling?

Yes

@sven-weber-db
sven-weber-db marked this pull request as ready for review June 8, 2026 09:40
@sven-weber-dbsven-weber-db changed the title [DRAFT][SPARK-56661] Addressing review comments from PR #55768[SPARK-56661] Addressing review comments from PR #55768Jun 8, 2026

@hvanhovellhvanhovell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

asf-gitbox-commits pushed a commit that referenced this pull request Jun 8, 2026
### What changes were proposed in this pull request?
This change addresses the open review comments from [pull request #55768](#55768). In summary, the following changes were made:
Correctness fixes (2)
1. SparkEnv.scala:161 — The created UDFDispatcherManager is now stored back into udfDispatcherManager =
Some(created), so the cache works and stop() properly closes dispatchers.
2. ExternalUDFPlanner.scala + logical/physical nodes + strategy — profile: Option[ResourceProfile] is now
threaded through MapPartitionsExternalUDF (logical), MapPartitionsExternalUDFExec (physical),
SparkStrategies, and UnifiedExternalUDFPlanner, so a ResourceProfile passed to mapInPandas is no longer
silently dropped.
Nits (5)
1. ExternalUDFExec.scala:65 — Reworded "CAN but MUST NOT cancel or close" → "may use the session but MUST
NOT cancel or close it"
2. MapPartitionsExternalUDFExec.scala:39-42 — Fixed stale Scaladoc: functionExpr → function, removed
non-existent resultAttributes
3. UDFDispatcherManager.scala:33 — [[stop]] → [[close]]
4. UDFDispatcherManager.scala:49 — "write lock is used by stop" → "close"
5. UDFDispatcherManager.scala:66 — Removed duplicate "quick path" comment
### Why are the changes needed?
They were requested in a review of the above linked PR.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Linting & re-running existing tests. Mostly nit changes.
### Was this patch authored or co-authored using generative AI tooling?
Yes
Closes#56367 from sven-weber-db/sven-weber_data/SPARK-56661.
Authored-by: Sven Weber <sven.weber@databricks.com>
Signed-off-by: Herman van Hövell <herman@databricks.com>
(cherry picked from commit 1592ec2)
Signed-off-by: Herman van Hövell <herman@databricks.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sven-weber-db@hvanhovell@haiyangsun-db