org.apache.spark.SparkException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • {code}SPARK_CLASSPATH=jsr166e-1.1.0.jar:spark-cassandra-connector_2.10-1.3.0-M1.jar:guava-jdk5-14.0.1.jar:cassandra-driver-core-2.1.5.jar:cassandra-thrift-2.1.3.jar:joda-time-2.3.jar bin/spark-shell --conf spark.cassandra.connection.host=127.0.0.1 {code} create a cassandra table like this: {code} CREATE TABLE test1( customer_id int , uri text , browser text, epoch bigint , PRIMARY KEY (customer_id , epoch,uri) ) {code} In spark-shell: {code} case class Test(val epoch:Long,val uri:String,val browser:String,val customer_id:Int) val test1=Test(1400820884,"http://foobar","Firefox",123242) val df=sc.parallelize(Seq(test1)).toDF import org.apache.spark.sql._ df.save("org.apache.spark.sql.cassandra",SaveMode.Overwrite,options = Map( "c_table" -> "test1", "keyspace" -> "yana_test")) {code} The last call (df.save) produces the following error: {code} org.apache.spark.SparkException: Job aborted due to stage failure: Task 3 in stage 0.0 failed 1 times, most recent failure: Lost task 3.0 in stage 0.0 (TID 3, localhost): java.lang.NumberFormatException: For input string: "http://foobar" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:441) at java.lang.Long.parseLong(Long.java:483) at scala.collection.immutable.StringLike$class.toLong(StringLike.scala:230) at scala.collection.immutable.StringOps.toLong(StringOps.scala:31) at com.datastax.spark.connector.types.TypeConverter$LongConverter$$anonfun$convertPF$3.applyOrElse(TypeConverter.scala:188) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:184) at com.datastax.spark.connector.types.TypeConverter$class.convert(TypeConverter.scala:38) at com.datastax.spark.connector.types.TypeConverter$JavaLongConverter$.com$datastax$spark$connector$types$NullableTypeConverter$$super$convert(TypeConverter.scala:196) at com.datastax.spark.connector.types.NullableTypeConverter$class.convert(TypeConverter.scala:51) at com.datastax.spark.connector.types.TypeConverter$JavaLongConverter$.convert(TypeConverter.scala:196) at com.datastax.spark.connector.types.TypeConverter$OptionToNullConverter$$anonfun$convertPF$23.applyOrElse(TypeConverter.scala:632) at com.datastax.spark.connector.types.TypeConverter$class.convert(TypeConverter.scala:38) at com.datastax.spark.connector.types.TypeConverter$OptionToNullConverter.com$datastax$spark$connector$types$NullableTypeConverter$$super$convert(TypeConverter.scala:625) at com.datastax.spark.connector.types.NullableTypeConverter$class.convert(TypeConverter.scala:51) at com.datastax.spark.connector.types.TypeConverter$OptionToNullConverter.convert(TypeConverter.scala:625) at com.datastax.spark.connector.writer.SqlRowWriter$$anonfun$readColumnValues$1.apply$mcVI$sp(SqlRowWriter.scala:21) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:141) at com.datastax.spark.connector.writer.SqlRowWriter.readColumnValues(SqlRowWriter.scala:20) at com.datastax.spark.connector.writer.SqlRowWriter.readColumnValues(SqlRowWriter.scala:8) at com.datastax.spark.connector.writer.BoundStatementBuilder.bind(BoundStatementBuilder.scala:35) at com.datastax.spark.connector.writer.GroupingBatchBuilder.next(GroupingBatchBuilder.scala:106) at com.datastax.spark.connector.writer.GroupingBatchBuilder.next(GroupingBatchBuilder.scala:31) at scala.collection.Iterator$class.foreach(Iterator.scala:727) at com.datastax.spark.connector.writer.GroupingBatchBuilder.foreach(GroupingBatchBuilder.scala:31) at com.datastax.spark.connector.writer.TableWriter$$anonfun$write$1.apply(TableWriter.scala:135) at com.datastax.spark.connector.writer.TableWriter$$anonfun$write$1.apply(TableWriter.scala:119) at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$withSessionDo$1.apply(CassandraConnector.scala:105) at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$withSessionDo$1.apply(CassandraConnector.scala:104) at com.datastax.spark.connector.cql.CassandraConnector.closeResourceAfterUse(CassandraConnector.scala:156) at com.datastax.spark.connector.cql.CassandraConnector.withSessionDo(CassandraConnector.scala:104) at com.datastax.spark.connector.writer.TableWriter.write(TableWriter.scala:119) at com.datastax.spark.connector.RDDFunctions$$anonfun$saveToCassandra$1.apply(RDDFunctions.scala:36) at com.datastax.spark.connector.RDDFunctions$$anonfun$saveToCassandra$1.apply(RDDFunctions.scala:36) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:61) at org.apache.spark.scheduler.Task.run(Task.scala:64) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203) 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) {code}
    via by Yana Kadiyska,
  • {code}SPARK_CLASSPATH=jsr166e-1.1.0.jar:spark-cassandra-connector_2.10-1.3.0-M1.jar:guava-jdk5-14.0.1.jar:cassandra-driver-core-2.1.5.jar:cassandra-thrift-2.1.3.jar:joda-time-2.3.jar bin/spark-shell --conf spark.cassandra.connection.host=127.0.0.1 {code} create a cassandra table like this: {code} CREATE TABLE test1( customer_id int , uri text , browser text, epoch bigint , PRIMARY KEY (customer_id , epoch,uri) ) {code} In spark-shell: {code} case class Test(val epoch:Long,val uri:String,val browser:String,val customer_id:Int) val test1=Test(1400820884,"http://foobar","Firefox",123242) val df=sc.parallelize(Seq(test1)).toDF import org.apache.spark.sql._ df.save("org.apache.spark.sql.cassandra",SaveMode.Overwrite,options = Map( "c_table" -> "test1", "keyspace" -> "yana_test")) {code} The last call (df.save) produces the following error: {code} org.apache.spark.SparkException: Job aborted due to stage failure: Task 3 in stage 0.0 failed 1 times, most recent failure: Lost task 3.0 in stage 0.0 (TID 3, localhost): java.lang.NumberFormatException: For input string: "http://foobar" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:441) at java.lang.Long.parseLong(Long.java:483) at scala.collection.immutable.StringLike$class.toLong(StringLike.scala:230) at scala.collection.immutable.StringOps.toLong(StringOps.scala:31) at com.datastax.spark.connector.types.TypeConverter$LongConverter$$anonfun$convertPF$3.applyOrElse(TypeConverter.scala:188) at scala.PartialFunction$AndThen.applyOrElse(PartialFunction.scala:184) at com.datastax.spark.connector.types.TypeConverter$class.convert(TypeConverter.scala:38) at com.datastax.spark.connector.types.TypeConverter$JavaLongConverter$.com$datastax$spark$connector$types$NullableTypeConverter$$super$convert(TypeConverter.scala:196) at com.datastax.spark.connector.types.NullableTypeConverter$class.convert(TypeConverter.scala:51) at com.datastax.spark.connector.types.TypeConverter$JavaLongConverter$.convert(TypeConverter.scala:196) at com.datastax.spark.connector.types.TypeConverter$OptionToNullConverter$$anonfun$convertPF$23.applyOrElse(TypeConverter.scala:632) at com.datastax.spark.connector.types.TypeConverter$class.convert(TypeConverter.scala:38) at com.datastax.spark.connector.types.TypeConverter$OptionToNullConverter.com$datastax$spark$connector$types$NullableTypeConverter$$super$convert(TypeConverter.scala:625) at com.datastax.spark.connector.types.NullableTypeConverter$class.convert(TypeConverter.scala:51) at com.datastax.spark.connector.types.TypeConverter$OptionToNullConverter.convert(TypeConverter.scala:625) at com.datastax.spark.connector.writer.SqlRowWriter$$anonfun$readColumnValues$1.apply$mcVI$sp(SqlRowWriter.scala:21) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:141) at com.datastax.spark.connector.writer.SqlRowWriter.readColumnValues(SqlRowWriter.scala:20) at com.datastax.spark.connector.writer.SqlRowWriter.readColumnValues(SqlRowWriter.scala:8) at com.datastax.spark.connector.writer.BoundStatementBuilder.bind(BoundStatementBuilder.scala:35) at com.datastax.spark.connector.writer.GroupingBatchBuilder.next(GroupingBatchBuilder.scala:106) at com.datastax.spark.connector.writer.GroupingBatchBuilder.next(GroupingBatchBuilder.scala:31) at scala.collection.Iterator$class.foreach(Iterator.scala:727) at com.datastax.spark.connector.writer.GroupingBatchBuilder.foreach(GroupingBatchBuilder.scala:31) at com.datastax.spark.connector.writer.TableWriter$$anonfun$write$1.apply(TableWriter.scala:135) at com.datastax.spark.connector.writer.TableWriter$$anonfun$write$1.apply(TableWriter.scala:119) at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$withSessionDo$1.apply(CassandraConnector.scala:105) at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$withSessionDo$1.apply(CassandraConnector.scala:104) at com.datastax.spark.connector.cql.CassandraConnector.closeResourceAfterUse(CassandraConnector.scala:156) at com.datastax.spark.connector.cql.CassandraConnector.withSessionDo(CassandraConnector.scala:104) at com.datastax.spark.connector.writer.TableWriter.write(TableWriter.scala:119) at com.datastax.spark.connector.RDDFunctions$$anonfun$saveToCassandra$1.apply(RDDFunctions.scala:36) at com.datastax.spark.connector.RDDFunctions$$anonfun$saveToCassandra$1.apply(RDDFunctions.scala:36) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:61) at org.apache.spark.scheduler.Task.run(Task.scala:64) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203) 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) {code}
    via by Yana Kadiyska,
  • GitHub comment 184#166739266
    via GitHub by nealmcb
    ,
  • Reading graph from file
    via Stack Overflow by eyeOfTheStorm
    ,
    • org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost): java.lang.NumberFormatException: For input string: "id" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Long.parseLong(Long.java:441) at java.lang.Long.parseLong(Long.java:483) at scala.collection.immutable.StringLike$class.toLong(StringLike.scala:230) at scala.collection.immutable.StringOps.toLong(StringOps.scala:31) at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC.parseTransactions(<console>:38) at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$anonfun$1.apply(<console>:42) at $iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$iwC$$anonfun$1.apply(<console>:42) at scala.collection.Iterator$$anon$11.next(Iterator.scala:328) at org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:285) at org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:171) at org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:78) at org.apache.spark.rdd.RDD.iterator(RDD.scala:268) at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:306) at org.apache.spark.rdd.RDD.iterator(RDD.scala:270) at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:306) at org.apache.spark.rdd.RDD.iterator(RDD.scala:270) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:73) at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41) at org.apache.spark.scheduler.Task.run(Task.scala:89) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214) 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)

    Users with the same issue

    tyson925
    1 times, last one,