1

I am unable to find a solution for reading a CSV file which has a column name repeated twice but while reading the CSV file it's giving an error complaining duplicate column names

Is there a way to handle this in spark without altering the CSV file ?.

My CSV data looks like this delimited by Tab (\t) & some extra spaces in each column.

col1    col2  col3
  2020  100   sometext  
serverliving.com
  • 437
  • 1
  • 6
  • 16

1 Answers1

1

You can also try using textfile method to read csv files and then convert them to DF or use them as RDDs after splitting and mapping them back!

Hope this works!

Vihit Shah
  • 314
  • 1
  • 5