score:2
I think the problem is that, before your code inside writeRDD(rdd)
executes ( since it is in a Future
), the rdd ( or the micro-batch RDD ) is already reclaimed by Apache Spark memory-management or BlockManager
.
Therefore, this error
org.apache.spark.SparkException: Job aborted due to stage failure: Task creation failed: org.apache.spark.SparkException: Attempted to use BlockRDD[820] at actorStream at Tests.scala:149 after its blocks have been removed!
You can fix this by first collecting the micro-batch collection and then passing it to writeRDD()
function. Something like this:
dStreams.foreach(_.foreachRDD { rdd =>
val coll = rdd.collect()
Future{ writeCollection(coll) }
})
Source: stackoverflow.com
Related Query
- Spark RDD Block Removed Before Use
- Is there a way to rewrite Spark RDD distinct to use mapPartitions instead of distinct?
- Spark Scala How to use replace function in RDD
- How to use regex in Spark Scala to convert RDD to Dataframe after reading an unstructured text file?
- how to use achieve below requirement using spark RDD
- Transactional block | Spark SQL, rdd
- do I need to use coalesce before saving my RDD data to file
- Specify Initialization for each Spark executor before compute on RDD
- How to access variables declared before try catch block in a catch block in spark scala
- How to use a java custom comparator for ordering a Spark RDD
- Sort RDD in Spark before publishing it to Kafka?
- Serializing Elasticsearch clients for use when looping Spark RDD in Scala
- How to convert rdd object to dataframe in spark
- Apache Spark - foreach Vs foreachPartition When to use What?
- What is RDD in spark
- How to define and use a User-Defined Aggregate Function in Spark SQL?
- How to use orderby() with descending order in Spark window functions?
- How to Use both Scala and Python in a same Spark project?
- How to use s3 with Apache spark 2.2 in the Spark shell
- Order by value in spark pair RDD
- How to create a Spark Dataset from an RDD
- How to use NOT IN clause in filter condition in spark
- RDD Aggregate in spark
- how to use Regexp_replace in spark
- Spark RDD default number of partitions
- Modify collection inside a Spark RDD foreach
- How to use constant value in UDF of Spark SQL(DataFrame)
- use length function in substring in spark
- How to transpose an RDD in Spark
- Why does Spark RDD partition has 2GB limit for HDFS?
More Query from same tag
- Compare two schema (column name + nullable) in Spark
- Playframeworks json Writes implicit requires explicit type, why?
- Scala Spark filter inside map
- How to compare the schema of a dataframe read from an RDBMS table against the same table on Hive?
- How to properly decompress gz archive in Scala
- com/mongodb/casbah/Imports$ ClassNotFound running spark-submit and Mongo
- Intellij 13.1.3 import project from sbt not working
- Using either for error handling in return
- Scala - Passing a function to Future.apply
- Best method for parallel log aggregation
- spark streaming join kafka topics
- Trait type parameters inference
- How to abstract from type of immutable value performing its transformations?
- Filtering a sequence based on item length
- Get json request body from cvs file in Gatling
- ReduceByKey after return from function which has return type Either
- mongo-scala-driver :how to add connection pool size in MOngoClient Settings
- Pig-Scala UDF exception- ScalaObject not found
- log4j duplicate messages when using AsyncAppender
- Write BigDecimal calculation as if it's just a usual Four arithmetic operations in Scala
- How come I can define generic exception types in Scala?
- I'm trying to convert some scala code to Java 8 to fell the new Lambda and parallel collections
- scala custom list build purely using functional approach
- Pattern matching a String as Seq[Char]
- How can I eliminate a parameter from constructor in a subclass in Scala
- How to dump / copy a a variable as code via IntellJ debugger?
- Conflict between Cassandra and Gatling
- Coderay alternative in Scala which gives formatted and syntax highlighted code
- How are nested functions and lexical scope compiled in JVM languages?
- Formatting a date in Spark dataframe leads to unexpected format