java.lang.StringIndexOutOfBoundsException: String index out of range: 1

0 votes

Hi,

I am getting an error in Spark. I tried to use groupByKey() function in scala. But it shows the below error.

ERROR executor.Executor: Exception in task 0.0 in stage 12.0 (TID 28)
java.lang.StringIndexOutOfBoundsException: String index out of range: 1

Can anyone tell me the reason?
Thank You
 

Jan 29 in Apache Spark by akhtar
• 1,440 points
33 views

1 answer to this question.

0 votes

Hi@akhtar,

I also faced this same problem. For my case I used map instead of flatMap. In flatMap each input item can be mapped to or more output items. So, you can try map in place of flatMap.

Thank You

answered Jan 31 by MD
• 2,750 points

Related Questions In Apache Spark

+1 vote
1 answer

Facing out-of-memory errors in Spark driver

I am guessing that the configuration set ...READ MORE

answered Feb 22, 2019 in Apache Spark by Rishab
63 views
0 votes
1 answer
0 votes
1 answer

Spark error: Caused by: java.lang.RuntimeException: The root scratch dir: /tmp/hive on HDFS should be writable.

Give  read-write permissions to  C:\tmp\hive folder Cd to winutils bin folder ...READ MORE

answered Jul 11, 2019 in Apache Spark by Rajiv
732 views
0 votes
0 answers
0 votes
1 answer

Scala: 30: error: value partitions is not a member of String

Try this code: val rdd= sc.textFile (“file.txt”, 5) rdd.partitions.size Output ...READ MORE

answered Jul 29, 2019 in Apache Spark by Nijit
162 views
+1 vote
1 answer
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,840 points
4,130 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,840 points
582 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
22,303 views
0 votes
1 answer

Caused by: java.lang.NumberFormatException: Empty String

Hi@akhtar, As we know text files are in ...READ MORE

answered Jan 31 in Apache Spark by MD
• 2,750 points
41 views