Repository navigation
[SPARK-2392] Executors should not start their own HTTP servers - #1335
Closed
andrewor14 wants to merge 1 commit into
Closed
andrewor14 wants to merge 1 commit into
andrewor14 wants to merge 1 commit into
Conversation
|
Merged build triggered. |
|
Merged build started. |
|
Merged build finished. |
|
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/16426/ |
Contributor
Author
|
Jenkins, test this please |
|
Merged build triggered. |
|
Merged build started. |
Contributor
|
LGTM. |
|
Merged build finished. All automated tests passed. |
|
All automated tests passed. |
Contributor
|
Thanks. Merging this in master. |
gzm55
pushed a commit
to MediaV/spark
that referenced
this pull request
Jul 18, 2014
Executors currently start their own unused HTTP file servers. This is because we use the same SparkEnv class for both executors and drivers, and we do not distinguish this case. In the longer term, we should separate out SparkEnv for the driver and SparkEnv for the executors. Author: Andrew Or <andrewor14@gmail.com> Closes apache#1335 from andrewor14/executor-http-server and squashes the following commits: 46ef263 [Andrew Or] Start HTTP server only on the driver Conflicts: core/src/main/scala/org/apache/spark/SparkEnv.scala
xiliu82
pushed a commit
to xiliu82/spark
that referenced
this pull request
Sep 4, 2014
Executors currently start their own unused HTTP file servers. This is because we use the same SparkEnv class for both executors and drivers, and we do not distinguish this case. In the longer term, we should separate out SparkEnv for the driver and SparkEnv for the executors. Author: Andrew Or <andrewor14@gmail.com> Closes apache#1335 from andrewor14/executor-http-server and squashes the following commits: 46ef263 [Andrew Or] Start HTTP server only on the driver
maropu
pushed a commit
that referenced
this pull request
Nov 17, 2020
…espect to aliases to avoid unneeded exchange/sort nodes
### What changes were proposed in this pull request?
This pull request tries to remove unneeded exchanges/sorts by normalizing the output partitioning and sortorder information correctly with respect to aliases.
Example: consider this join of three tables:
|SELECT t2id, t3.id as t3id
|FROM (
| SELECT t1.id as t1id, t2.id as t2id
| FROM t1, t2
| WHERE t1.id = t2.id
|) t12, t3
|WHERE t1id = t3.id
The plan for this looks like:
*(9) Project [t2id#1034L, id#1004L AS t3id#1035L]
+- *(9) SortMergeJoin [t1id#1033L], [id#1004L], Inner
:- *(6) Sort [t1id#1033L ASC NULLS FIRST], false, 0
: +- Exchange hashpartitioning(t1id#1033L, 5), true, [id=#1343] <------------------------------
: +- *(5) Project [id#996L AS t1id#1033L, id#1000L AS t2id#1034L]
: +- *(5) SortMergeJoin [id#996L], [id#1000L], Inner
: :- *(2) Sort [id#996L ASC NULLS FIRST], false, 0
: : +- Exchange hashpartitioning(id#996L, 5), true, [id=#1329]
: : +- *(1) Range (0, 10, step=1, splits=2)
: +- *(4) Sort [id#1000L ASC NULLS FIRST], false, 0
: +- Exchange hashpartitioning(id#1000L, 5), true, [id=#1335]
: +- *(3) Range (0, 20, step=1, splits=2)
+- *(8) Sort [id#1004L ASC NULLS FIRST], false, 0
+- Exchange hashpartitioning(id#1004L, 5), true, [id=#1349]
+- *(7) Range (0, 30, step=1, splits=2)
In this plan, the marked exchange could have been avoided as the data is already partitioned on "t1.id". This happens because AliasAwareOutputPartitioning class handles aliases only related to HashPartitioning. This change normalizes all output partitioning based on aliasing happening in Project.
### Why are the changes needed?
To remove unneeded exchanges.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
New UT added.
On TPCDS 1000 scale, this change improves the performance of query 95 from 330 seconds to 170 seconds by removing the extra Exchange.
Closes #30300 from prakharjain09/SPARK-33399-outputpartitioning.
Authored-by: Prakhar Jain <prakharjain09@gmail.com>
Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org>
wangyum
pushed a commit
that referenced
this pull request
May 26, 2023
…rtitioning and sortorder with respect to aliases to avoid unneeded exchange/sort nodes (#1092) * [SPARK-31078][SQL] Respect aliases in output ordering Currently, in the following scenario, an unnecessary `Sort` node is introduced: ```scala withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "0") { val df = (0 until 20).toDF("i").as("df") df.repartition(8, df("i")).write.format("parquet") .bucketBy(8, "i").sortBy("i").saveAsTable("t") val t1 = spark.table("t") val t2 = t1.selectExpr("i as ii") t1.join(t2, t1("i") === t2("ii")).explain } ``` ``` == Physical Plan == *(3) SortMergeJoin [i#8], [ii#10], Inner :- *(1) Project [i#8] : +- *(1) Filter isnotnull(i#8) : +- *(1) ColumnarToRow : +- FileScan parquet default.t[i#8] Batched: true, DataFilters: [isnotnull(i#8)], Format: Parquet, Location: InMemoryFileIndex[file:/..., PartitionFilters: [], PushedFilters: [IsNotNull(i)], ReadSchema: struct<i:int>, SelectedBucketsCount: 8 out of 8 +- *(2) Sort [ii#10 ASC NULLS FIRST], false, 0 <==== UNNECESSARY +- *(2) Project [i#8 AS ii#10] +- *(2) Filter isnotnull(i#8) +- *(2) ColumnarToRow +- FileScan parquet default.t[i#8] Batched: true, DataFilters: [isnotnull(i#8)], Format: Parquet, Location: InMemoryFileIndex[file:/..., PartitionFilters: [], PushedFilters: [IsNotNull(i)], ReadSchema: struct<i:int>, SelectedBucketsCount: 8 out of 8 ``` Notice that `Sort [ii#10 ASC NULLS FIRST], false, 0` is introduced even though the underlying data is already sorted. This is because `outputOrdering` doesn't handle aliases correctly. This PR proposes to fix this issue. To better handle aliases in `outputOrdering`. Yes, now with the fix, the `explain` prints out the following: ``` == Physical Plan == *(3) SortMergeJoin [i#8], [ii#10], Inner :- *(1) Project [i#8] : +- *(1) Filter isnotnull(i#8) : +- *(1) ColumnarToRow : +- FileScan parquet default.t[i#8] Batched: true, DataFilters: [isnotnull(i#8)], Format: Parquet, Location: InMemoryFileIndex[file:/..., PartitionFilters: [], PushedFilters: [IsNotNull(i)], ReadSchema: struct<i:int>, SelectedBucketsCount: 8 out of 8 +- *(2) Project [i#8 AS ii#10] +- *(2) Filter isnotnull(i#8) +- *(2) ColumnarToRow +- FileScan parquet default.t[i#8] Batched: true, DataFilters: [isnotnull(i#8)], Format: Parquet, Location: InMemoryFileIndex[file:/..., PartitionFilters: [], PushedFilters: [IsNotNull(i)], ReadSchema: struct<i:int>, SelectedBucketsCount: 8 out of 8 ``` Tests added. Closes #27842 from imback82/alias_aware_sort_order. Authored-by: Terry Kim <yuminkim@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> * [SPARK-33399][SQL] Normalize output partitioning and sortorder with respect to aliases to avoid unneeded exchange/sort nodes This pull request tries to remove unneeded exchanges/sorts by normalizing the output partitioning and sortorder information correctly with respect to aliases. Example: consider this join of three tables: |SELECT t2id, t3.id as t3id |FROM ( | SELECT t1.id as t1id, t2.id as t2id | FROM t1, t2 | WHERE t1.id = t2.id |) t12, t3 |WHERE t1id = t3.id The plan for this looks like: *(9) Project [t2id#1034L, id#1004L AS t3id#1035L] +- *(9) SortMergeJoin [t1id#1033L], [id#1004L], Inner :- *(6) Sort [t1id#1033L ASC NULLS FIRST], false, 0 : +- Exchange hashpartitioning(t1id#1033L, 5), true, [id=#1343] <------------------------------ : +- *(5) Project [id#996L AS t1id#1033L, id#1000L AS t2id#1034L] : +- *(5) SortMergeJoin [id#996L], [id#1000L], Inner : :- *(2) Sort [id#996L ASC NULLS FIRST], false, 0 : : +- Exchange hashpartitioning(id#996L, 5), true, [id=#1329] : : +- *(1) Range (0, 10, step=1, splits=2) : +- *(4) Sort [id#1000L ASC NULLS FIRST], false, 0 : +- Exchange hashpartitioning(id#1000L, 5), true, [id=#1335] : +- *(3) Range (0, 20, step=1, splits=2) +- *(8) Sort [id#1004L ASC NULLS FIRST], false, 0 +- Exchange hashpartitioning(id#1004L, 5), true, [id=#1349] +- *(7) Range (0, 30, step=1, splits=2) In this plan, the marked exchange could have been avoided as the data is already partitioned on "t1.id". This happens because AliasAwareOutputPartitioning class handles aliases only related to HashPartitioning. This change normalizes all output partitioning based on aliasing happening in Project. To remove unneeded exchanges. No New UT added. On TPCDS 1000 scale, this change improves the performance of query 95 from 330 seconds to 170 seconds by removing the extra Exchange. Closes #30300 from prakharjain09/SPARK-33399-outputpartitioning. Authored-by: Prakhar Jain <prakharjain09@gmail.com> Signed-off-by: Takeshi Yamamuro <yamamuro@apache.org> * [CARMEL-6306] Fix ut * [CARMEL-6306] Fix alias not compatible with ebay skew implementation Co-authored-by: Terry Kim <yuminkim@gmail.com> Co-authored-by: Prakhar Jain <prakharjain09@gmail.com>
github-actions Bot
pushed a commit
to MaxGekk/spark
that referenced
this pull request
Nov 4, 2026
…'s matrix (apache#1335) ### What changes were proposed in this pull request? **Scope `DeclineSink.java` to Varka.** The Build decides from a pull request's changed files whether it runs only Varka's jobs or Spark's whole module matrix: a file that `is_varka_scoped` (`dev/sparktestsupport/modules.py`) does not recognise selects its Spark module. `sql/catalyst/.../expressions/codegen/DeclineSink.java` is a Varka class - only Varka's compilers use it, and it is package-private - but it carries no Varka name, so a change to it selected `catalyst` and everything that depends on it. apache#1324 changed it and its Build ran the whole matrix, 2 h 18 min, though all its other files were Varka's. The scope list now names the file, with a doctest. The other files Varka commits added without the name stay unscoped on purpose: Spark-side benchmarks that measure Spark's own code generation, the Arrow cache's shared reader and writer, composite actions Spark's own workflows also use, and the JUnit listener registration every catalyst JUnit run reads. **Run the tier split's self-test in the Build.** The nightly JIT tier-split job (apache#1332) checks its own night-deciding check on fixture logs before each run. Its line in the Build's Varka checks was left out of apache#1332 so that apache#1332's own Build stayed scoped; it rides here because this change edits a non-Varka file and runs the whole matrix once anyway. ### Why are the changes needed? Every pull request that touches `DeclineSink.java` paid a full Spark module matrix (about two and a half hours, on the fork's shared runner slots) for a Varka-only change. ### Does this PR introduce _any_ user-facing change? No. It changes CI test selection and adds one CI step. ### How was this patch tested? - `cd dev && python3 -m doctest sparktestsupport/modules.py` passes, including the new case; the pattern is anchored and rejects near-miss paths (a prefixed path, the test tree, a `.bak` copy). - With the pattern, apache#1324's 19 changed files classify as Varka-scoped; without it, `DeclineSink.java` alone makes them Spark's. - `git grep DeclineSink` finds only Varka files. - `dev/varka_tier_split.py --self-test` passes on this tree, which now includes apache#1332. - `dev/varka_plan_lint.py`, `dev/varka_lint.py`, `dev/varka_quote_check.py` and ruff pass. An independent review found the scope change correct and flagged that the self-test step needed apache#1332 merged first; this branch now includes it. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
MaxGekk
added a commit
to MaxGekk/spark
that referenced
this pull request
Nov 5, 2026
…pache#1366) ### What changes were proposed in this pull request? Brings ten rows of milestone 8's plan up to date with the pull requests that merged their work. Row 572 asked for it, and this is its first part. - **Rows 560, 562 and 568 are `Done`.** 560 and 562 said "done when it merges", and apache#1326 and apache#1335 merged. Row 568's three done-when clauses hold on master since apache#1363: `nanByNess` is gone, the lint rule flags each shape in its self-test and finds no expression in the tree, and the opt-in sweeps passed 46 of 46. - **Rows 554, 555, 557, 558, 559, 563 and 546 stay `Started`,** each now naming the pull request that merged it (apache#1312, apache#1313, apache#1332, apache#1320, apache#1329, apache#1340 with apache#1344, and apache#1293) and its date. I did not mark them `Done`: their done-when clauses name checks, such as a Build failing a change over the cap or a matrix no longer failing a test, that I have not confirmed from a run. Row 563's text no longer lists its pull request as left. - **Row 572 is `Started`** and lists what is left: rows 497, 365 and 503, and the rows the triage named whose text is behind merged work (157, 348, 349, 538, 332, 333, 343, 341, 331, 340, 342, 344, 377 and 330). The PR numbers and merge dates were read from the pull requests. ### Why are the changes needed? A row is the only record of why a change exists. A row that still says "Started" or "left: the pull request" after the pull request merged misleads a reader and any count of the milestone's finished rows. ### Does this PR introduce _any_ user-facing change? No. It changes the plan only. ### How was this patch tested? - `dev/varka_plan_lint.py --check --offline`: 0 findings. - `dev/varka_quote_check.py`: 0 orphans. - The pre-commit rules pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Sonnet 5.5)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executors currently start their own unused HTTP file servers. This is because we use the same SparkEnv class for both executors and drivers, and we do not distinguish this case.
In the longer term, we should separate out SparkEnv for the driver and SparkEnv for the executors.