Details
-
Sub-task
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.6.1
-
None
Description
There's this odd bit of code in JavaStratifiedSamplingExample:
// specify the exact fraction desired from each key Map<K, Object> ImmutableMap<Integer, Object> fractions = ImmutableMap.of(1, (Object)0.1, 2, (Object) 0.6, 3, (Object) 0.3); // Get an approximate sample from each stratum JavaPairRDD<Integer, Character> approxSample = data.sampleByKey(false, fractions);
It highlights a problem like that in https://issues.apache.org/jira/browse/SPARK-12604 where Scala primitive types are used where Java requires an object, and the result is that a signature that logically takes Double (objects) takes an Object in the Java API. It's an easy, similar fix.
Attachments
Issue Links
- duplicates
-
SPARK-12604 Java count(AprroxDistinct)ByKey methods return Scala Long not Java
- Resolved
- links to