Custom delimiter csv reader spark

后端 未结 1 425
终归单人心
终归单人心 2021-02-11 16:51

I would like to read in a file with the following structure with Apache Spark.

628344092\\t20070220\\t200702\\t2007\\t2007.1370

The delimiter

相关标签:
1条回答
  • 2021-02-11 17:51

    Use spark.read.option("delimiter", "\t").csv(file) or sep instead of delimiter.

    If it's literally \t, not tab special character, use double \: spark.read.option("delimiter", "\\t").csv(file)

    0 讨论(0)
提交回复
热议问题