Skip to content

SPARK-1973. Add randomSplit to JavaRDD (with tests, and tidy Java tests) - #919

Closed
srowen wants to merge 6 commits into
apache:masterfrom
srowen:SPARK-1973
Closed

srowen wants to merge 6 commits into
apache:masterfrom
srowen:SPARK-1973

Conversation

@srowen

@srowen srowen commented May 30, 2014

Copy link
Copy Markdown
Member

I'd like to use randomSplit through the Java API, and would like to add a convenience wrapper for this method to JavaRDD. This is fairly trivial. (In fact, is the intent that JavaRDD not wrap every RDD method? and that sometimes users should just use JavaRDD.wrapRDD()?)

Along the way, I added tests for it, and also touched up the Java API test style and behavior. This is maybe the more useful part of this small change.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15304/

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.

Can we use accumulator to test foreach? Creating new files makes the test a little complicated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let me look into that. This was intended to be less fragile that relying on a class variable that happens to be shared, but maybe an accumulator is even more robust.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15353/

@mengxr

mengxr commented Jun 3, 2014

Copy link
Copy Markdown
Contributor

@srowen It is not mergeable now. Could you try to merge the master branch first? Also, I did some further cleaning but I couldn't send a PR to your repo (cannot find your repo from the list). Can you merge https://github.com/mengxr/spark/tree/SPARK-1973 as well? Thanks!

@srowen

srowen commented Jun 3, 2014

Copy link
Copy Markdown
Member Author

Done -- rebased, added your commit, and a few more of my own.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15403/

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.

This line is too wide.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oops, fixed, and I fixed other pre-existing long lines while at it.

@AmplabJenkins

Copy link
Copy Markdown

Build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Build started.

@AmplabJenkins

Copy link
Copy Markdown

Build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15443/

@asfgit asfgit closed this in d341b17 Jun 4, 2014
@mengxr

mengxr commented Jun 4, 2014

Copy link
Copy Markdown
Contributor

Merged. Thanks!

@srowen
srowen deleted the SPARK-1973 branch June 5, 2014 09:57
pdeyhim pushed a commit to pdeyhim/spark-1 that referenced this pull request Jun 25, 2014
I'd like to use randomSplit through the Java API, and would like to add a convenience wrapper for this method to JavaRDD. This is fairly trivial. (In fact, is the intent that JavaRDD not wrap every RDD method? and that sometimes users should just use JavaRDD.wrapRDD()?)

Along the way, I added tests for it, and also touched up the Java API test style and behavior. This is maybe the more useful part of this small change.

Author: Sean Owen <sowen@cloudera.com>
Author: Xiangrui Meng <meng@databricks.com>

This patch had conflicts when merged, resolved by
Committer: Xiangrui Meng <meng@databricks.com>

Closes apache#919 from srowen/SPARK-1973 and squashes the following commits:

148cb7b [Sean Owen] Some final Java test polish, while we are at it
1fc3f3e [Xiangrui Meng] more cleaning on Java 8 tests
9ebc57f [Sean Owen] Use accumulator instead of temp files to test foreach
5efb0be [Sean Owen] Add Java randomSplit, and unit tests (including for sample)
5dcc158 [Sean Owen] Simplified Java 8 test with new language features, and fixed the name of MLB's greatest team
91a1769 [Sean Owen] Touch up minor style issues in existing Java API suite test
xiliu82 pushed a commit to xiliu82/spark that referenced this pull request Sep 4, 2014
I'd like to use randomSplit through the Java API, and would like to add a convenience wrapper for this method to JavaRDD. This is fairly trivial. (In fact, is the intent that JavaRDD not wrap every RDD method? and that sometimes users should just use JavaRDD.wrapRDD()?)

Along the way, I added tests for it, and also touched up the Java API test style and behavior. This is maybe the more useful part of this small change.

Author: Sean Owen <sowen@cloudera.com>
Author: Xiangrui Meng <meng@databricks.com>

This patch had conflicts when merged, resolved by
Committer: Xiangrui Meng <meng@databricks.com>

Closes apache#919 from srowen/SPARK-1973 and squashes the following commits:

148cb7b [Sean Owen] Some final Java test polish, while we are at it
1fc3f3e [Xiangrui Meng] more cleaning on Java 8 tests
9ebc57f [Sean Owen] Use accumulator instead of temp files to test foreach
5efb0be [Sean Owen] Add Java randomSplit, and unit tests (including for sample)
5dcc158 [Sean Owen] Simplified Java 8 test with new language features, and fixed the name of MLB's greatest team
91a1769 [Sean Owen] Touch up minor style issues in existing Java API suite test
agirish pushed a commit to HPEEzmeral/apache-spark that referenced this pull request May 5, 2022
MaxGekk added a commit to MaxGekk/spark that referenced this pull request Oct 18, 2026
…kernel (apache#920)

### What changes were proposed in this pull request?

A new row of milestone 7, 389, with its record `sql/varka/plans/m7/VARKA-389.md` and its line in the plan's table. No code changes.

The milestone's close regenerated `VarkaColdStartBenchmark` on the milestone 7 build and found the kernel warm-up's verdict RELEASED, the 60-second deadline reached with no verdict, on every projection shape of the benchmark (16 to 100 entries of `greatest(add_months(d, k), date_add(d, k), last_day(d))`), on the development laptop and on two GitHub-hosted runners alike, 51 of 71 verdicts each, where the file of 28 September on the same laptop had all 71 COMPILED. The kernels the warm-up gave up on run 1.3x to 2x slower per query at 100K rows and 2.5x to 4x slower at 2M rows than on 28 September, with averages that spike to seconds. The record states those numbers against the committed files, what the verdict measures (an allocation probe over the kernel's calls, not a compile check), the first reads (every method under HugeMethodLimit; each of the sixteen group methods at about 400 Vector API call sites against a call-site budget of 93, left there by the heavy-group exemption; C2 asked for all sixteen within seconds of the warm-up's start and out of nodes on one; VARKA-379's `guardedRange` on every output, which the first bisection step has already cleared), the investigation in order and six predictions registered before it runs.

**Update, 18 October, 14:40.** The row's record now names the cause and measures every fix option (`VARKA-389.md` 8.3 to 8.6). The cause is VARKA-295's Vector API template warm-up (apache#827, `aa457c3797b`, 15 October): the kernel's bytecode is identical before and after the regression, and in a JVM where vector code ran before the first warmed shape the warm-up's rounds deoptimise the already-compiled shared templates with `unstable_if` traps, leaving one decompile on each; a four-output group method inlines `IntVector.lanewise` six hundred times, C2 sums that decompile once per copy, crosses its cutoff of 201 and keeps 367 virtual calls, under which the vectors box. Measured on the 16-entry rung: the warm-up run at the shape cache's first build compiles the shape in 1.5 s; the warm-up off, 1.6 s; the JVM's recompilation cutoff and trap limit raised, 1.4 to 1.9 s; 100 rounds, still released; groups of one output, 2.4 to 3.3 s. The owner chooses the direction; the fix follows in its own pull request.

### Why are the changes needed?

A milestone's rows are what its issue mirror tracks, so a regression found by the close becomes a row before anything else is done about it. Milestone 7 does not close while this stands: its close pull request (apache#919) is held in draft and its tag moves to the commit that resolves this row.

### Does this PR introduce _any_ user-facing change?

No. A plan row and a task record.

### How was this patch tested?

The repository's pre-commit check on both files finds nothing, and the issue mirror's dry run (`python3 dev/varka_issues.py --plan sql/varka/plans/m7/PLAN.md`) lists the new row as the one issue to open.

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

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to 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