hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sandy Ryza (JIRA)" <>
Subject [jira] [Commented] (HIVE-7540) NotSerializableException encountered when using sortByKey transformation
Date Tue, 05 Aug 2014 04:35:12 GMT


Sandy Ryza commented on HIVE-7540:

In general a Spark closure is a Serializable object.  The proposal would be to allow objects
underneath this object to be Writable, but not Serializable.  I'm not aware of a way to tell
Java serialization to listen for objects that implement a certain type as it navigates the
object graph and use a custom serialization for them.

I'm looking at the RangePartitioner code now and it might be possible to use custom serialization
for the range bounds.  I just don't see a way to do it in the general case.

> NotSerializableException encountered when using sortByKey transformation
> ------------------------------------------------------------------------
>                 Key: HIVE-7540
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Spark
>         Environment: Spark-1.0.1
>            Reporter: Rui Li
> This exception is thrown when sortByKey is used as the shuffle transformation between
MapWork and ReduceWork:
> {quote}
> org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable:
>     at$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1049)
>     at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1033)
>     at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1031)
>     at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
>     at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
>     at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1031)
>     at$apache$spark$scheduler$DAGScheduler$$submitMissingTasks(DAGScheduler.scala:772)
>     at$apache$spark$scheduler$DAGScheduler$$submitStage(DAGScheduler.scala:715)
>     at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$submitStage$4.apply(DAGScheduler.scala:719)
>     at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$submitStage$4.apply(DAGScheduler.scala:718)
>     at scala.collection.immutable.List.foreach(List.scala:318)
>     at$apache$spark$scheduler$DAGScheduler$$submitStage(DAGScheduler.scala:718)
>     at org.apache.spark.scheduler.DAGScheduler.handleJobSubmitted(DAGScheduler.scala:699)
> …
> {quote}
>  The root cause is that the RangePartitioner used by sortByKey contains rangeBounds:
Array[BytesWritable], which is considered not serializable in spark.
> A workaround to this issue is to set the number of partitions to 1 when calling sortByKey,
in which case the rangeBounds will be just an empty array.
> NO PRECOMMIT TESTS. This is for spark branch only.

This message was sent by Atlassian JIRA

View raw message