Skip to content

[MINOR] Issue: Change "slice" vs "partition" in exception messages (and code?)#17565

Closed
asmith26 wants to merge 2 commits intoapache:masterfrom
asmith26:master
Closed

[MINOR] Issue: Change "slice" vs "partition" in exception messages (and code?)#17565
asmith26 wants to merge 2 commits intoapache:masterfrom
asmith26:master

Conversation

@asmith26
Copy link
Copy Markdown
Contributor

@asmith26 asmith26 commented Apr 7, 2017

What changes were proposed in this pull request?

Came across the term "slice" when running some spark scala code. Consequently, a Google search indicated that "slices" and "partitions" refer to the same things; indeed see:

Thus this pull request fixes the occurrence of slice I came accross. Nonetheless, it would appear there are still many references to "slice/slices" - thus I thought I'd raise this Pull Request to address the issue (sorry if this is the wrong place, I'm not too familar with raising apache issues).

How was this patch tested?

(Not tested locally - only a minor exception message change.)

Please review http://spark.apache.org/contributing.html before opening a pull request.

@srowen
Copy link
Copy Markdown
Member

srowen commented Apr 7, 2017

Can you look for other similar occurrences? I generally agree that 'partitions' is preferred in docs and messages.

See http://spark.apache.org/contributing.html too. Add [MINOR] to the title for example.

@asmith26 asmith26 changed the title Issue: Change "slice" vs "partition" in exception messages (and code?) [MINOR] Issue: Change "slice" vs "partition" in exception messages (and code?) Apr 7, 2017
@asmith26
Copy link
Copy Markdown
Contributor Author

asmith26 commented Apr 7, 2017

Thanks for the info @srowen

Regarding similar occurrences, I can't find any usages of "slice" within any remaining exception messages (searching with grep), however it would appear there are lots of usage in the general code (as indicated via GitHub search) that perhaps could be made clearer.

@srowen
Copy link
Copy Markdown
Member

srowen commented Apr 7, 2017

Look at SparkALS.scala in examples. That could be fixed.
Arguably so should all of ParallelCollectionRDD but that isn't user-facing.

@asmith26
Copy link
Copy Markdown
Contributor Author

asmith26 commented Apr 7, 2017

Great find!

I found a possible few more running the following from the spark root dir (which I know won't necessarily find all):

$ grep -ir "slice" | grep -i "usage"
examples/src/main/scala/org/apache/spark/examples/SparkLR.scala: * Usage: SparkLR [slices]
examples/src/main/scala/org/apache/spark/examples/BroadcastTest.scala: * Usage: BroadcastTest [slices] [numElem] [blockSize]
examples/src/main/scala/org/apache/spark/examples/SparkALS.scala:        System.err.println("Usage: SparkALS [M] [U] [F] [iters] [slices]")
examples/src/main/scala/org/apache/spark/examples/MultiBroadcastTest.scala: * Usage: MultiBroadcastTest [slices] [numElem]
examples/src/main/java/org/apache/spark/examples/JavaTC.java: * Usage: JavaTC [slices]
examples/src/main/java/org/apache/spark/examples/JavaSparkPi.java: * Usage: JavaSparkPi [slices]
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:  usage = "_FUNC_(str, pos[, len]) - Returns the substring of `str` that starts at `pos` and is of length `len`, or the slice of byte array that starts at `pos` and is of length `len`.",

Shall I substitute "partition" for "slice" in all of the above?

@srowen
Copy link
Copy Markdown
Member

srowen commented Apr 7, 2017

I agree with fixing all of the examples. The catalyst class is something else, shouldn't be changed.

@asmith26
Copy link
Copy Markdown
Contributor Author

asmith26 commented Apr 7, 2017

Thanks for confirming, all done - please feel free to let me know if you find any others (or if I've made a mistake with my commits).

Thanks for your help!

@srowen
Copy link
Copy Markdown
Member

srowen commented Apr 9, 2017

Merged to master

@SparkQA
Copy link
Copy Markdown

SparkQA commented Apr 9, 2017

Test build #3650 has started for PR 17565 at commit 844df10.

@asfgit asfgit closed this in 34fc48f Apr 9, 2017
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