You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "koert kuipers (JIRA)" <ji...@apache.org> on 2016/11/30 18:38:58 UTC

[jira] [Comment Edited] (SPARK-18651) KeyValueGroupedDataset[K, V].reduceGroups cannot handle primitive for V

    [ https://issues.apache.org/jira/browse/SPARK-18651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15709352#comment-15709352 ] 

koert kuipers edited comment on SPARK-18651 at 11/30/16 6:38 PM:
-----------------------------------------------------------------

Fixed in master, fixed in branch-2.1, still issue in branch-2.0

i think this can be closed


was (Author: koert):
Fixed in master, still issue in branch-2.0

> KeyValueGroupedDataset[K, V].reduceGroups cannot handle primitive for V
> -----------------------------------------------------------------------
>
>                 Key: SPARK-18651
>                 URL: https://issues.apache.org/jira/browse/SPARK-18651
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.2
>            Reporter: koert kuipers
>
> run:
> {noformat}
> val df = Seq(1, 2, 3)
>   .toDS
>   .groupByKey(x => x)
>   .reduceGroups(_ + _)
> df.show
> {noformat}
> result:
> {noformat}
> org.apache.spark.SparkException: Job aborted due to stage failure: Task 2 in stage 143.0 failed 1 times, most recent failure: Lost task 2.0 in stage 143.0 (TID 514, localhost): java.lang.NullPointerException
> at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown Source)
> at org.apache.spark.sql.execution.aggregate.HashAggregateExec.createHashMap(HashAggregateExec.scala:296)
> at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.agg_doAggregateWithKeys$(Unknown Source)
> at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source)
> at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
> at org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$8$$anon$1.hasNext(WholeStageCodegenExec.scala:370)
> at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:408)
> at org.apache.spark.shuffle.sort.BypassMergeSortShuffleWriter.write(BypassMergeSortShuffleWriter.java:125)
> at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:79)
> at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:47)
> at org.apache.spark.scheduler.Task.run(Task.scala:86)
> at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
> the issue is the null in ReduceAggregator.zero
> for a primitive type this null leads to the NPE. instead for primitive types we should do a dummy/default value (0 for int, false for boolean, etc.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org