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-4795][Core] Redesign the "primitive type => Writable" implicit APIs to make them be activated automatically #3642
Conversation
Test build #24243 has started for PR 3642 at commit
|
Test build #24244 has started for PR 3642 at commit
|
Test build #24243 has finished for PR 3642 at commit
|
Test FAILed. |
Test build #24244 has finished for PR 3642 at commit
|
Test FAILed. |
Test build #24245 has started for PR 3642 at commit
|
@@ -40,7 +40,7 @@ class ShortestPathsSuite extends FunSuite with LocalSparkContext { | |||
val graph = Graph.fromEdgeTuples(edges, 1) | |||
val landmarks = Seq(1, 4).map(_.toLong) | |||
val results = ShortestPaths.run(graph, landmarks).vertices.collect.map { | |||
case (v, spMap) => (v, spMap.mapValues(_.get)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example of breaking source compatibility, although it's used the implicit intToIntWritable
occasionally. _.get
=> intToIntWritable(_).get
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can keep xxxToXxxWritable
still implicit for the source compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think you can keep that and have the new one because the compiler will complain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any example? I added implicit to them and compiled codes successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they are not ambiguous, I'd add the implicits back to make sure we never break.
@ankurdave - why is there a get in this test case? Is the get just redundant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does look like the get is redundant, since Int should be sufficient for this purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they are not ambiguous, I'd add the implicits back to make sure we never break.
I added them back.
Test build #24245 has finished for PR 3642 at commit
|
Test PASSed. |
@zsxwing if we merge this one, are there any other usecases for importing SparkContext._ ? |
Conflicts: core/src/main/scala/org/apache/spark/SparkContext.scala
Test build #26636 has started for PR 3642 at commit
|
There will be no implicit methods/objects in SparkContext object. So people don't need to import Since the compatibility is very important, it's better to get more pairs of eyes to look at it. |
Test build #26636 has finished for PR 3642 at commit
|
Test FAILed. |
Jenkins, retest this please. |
1 similar comment
Jenkins, retest this please. |
Test build #26647 has started for PR 3642 at commit
|
Test build #26647 has finished for PR 3642 at commit
|
Test FAILed. |
Jenkins, retest this please. |
Test build #26651 has started for PR 3642 at commit
|
Test build #26651 has finished for PR 3642 at commit
|
Test PASSed. |
Test build #26704 has started for PR 3642 at commit
|
Test build #26704 has finished for PR 3642 at commit
|
Test PASSed. |
Ok I'm going to merge this. Thanks for working on it. |
… APIs to make them be activated automatically Try to redesign the "primitive type => Writable" implicit APIs to make them be activated automatically and without breaking binary compatibility. However, this PR will breaking the source compatibility if people use `xxxToXxxWritable` occasionally. See the unit test in `graphx`. Author: zsxwing <zsxwing@gmail.com> Closes #3642 from zsxwing/SPARK-4795 and squashes the following commits: 914b2d6 [zsxwing] Add implicit back to the Writables methods 0b9017f [zsxwing] Add some docs a0e8509 [zsxwing] Merge branch 'master' into SPARK-4795 39343de [zsxwing] Fix the unit test 64853af [zsxwing] Reorganize the rest 'implicit' methods in SparkContext (cherry picked from commit d37978d) Signed-off-by: Reynold Xin <rxin@databricks.com>
Try to redesign the "primitive type => Writable" implicit APIs to make them be activated automatically and without breaking binary compatibility.
However, this PR will breaking the source compatibility if people use
xxxToXxxWritable
occasionally. See the unit test ingraphx
.