You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Sean Owen (JIRA)" <ji...@apache.org> on 2015/07/06 18:13:04 UTC

[jira] [Commented] (SPARK-8843) DStream transform function receives null instead of RDD

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

Sean Owen commented on SPARK-8843:
----------------------------------

Hm, what behavior do you suggest? The API presents an RDD, but there are no RDDs. It has to return null or not trigger your method.

> DStream transform function receives null instead of RDD
> -------------------------------------------------------
>
>                 Key: SPARK-8843
>                 URL: https://issues.apache.org/jira/browse/SPARK-8843
>             Project: Spark
>          Issue Type: Bug
>          Components: Streaming
>    Affects Versions: 1.4.0
>            Reporter: Vincent Debergue
>
> When using the {{transform}} function on a {{DStream}} with empty values, we can get a {{NullPointerException}} 
> You can reproduce the issue with this piece of code in the spark-shell:
> {code}
> import org.apache.spark.streaming.dstream.InputDStream
> import org.apache.spark.streaming._
> import scala.reflect.ClassTag
> class EmptyDStream[T: scala.reflect.ClassTag](ssc: org.apache.spark.streaming.StreamingContext) extends InputDStream[T](ssc) {
>   override def compute(t: org.apache.spark.streaming.Time) = None
>   override def start() = {}
>   override def stop() = {}
> }
> val ssc = new StreamingContext(sc, Seconds(2))
> val in = new EmptyDStream[Int](ssc)
> val out = in.transform { rdd =>
>   rdd.map(_ + 1) // rdd is in fact null here
> }
> out.print()
> ssc.start() // NullPointerException
> {code}
> This bug is very likely to come from the usage of {{orNull}} on the scala {{Option}}: https://github.com/apache/spark/blob/branch-1.4/streaming/src/main/scala/org/apache/spark/streaming/dstream/TransformedDStream.scala#L40



--
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