创建数据帧时scala中的错误

时间:2018-03-05 08:49:12

标签: scala apache-spark-sql

收到错误unclosed string literal

代码:

val relianceDF = relianceRDD.map(rel => {
 (rel.split(",")(0).toInt,
  rel.split(",")(1),
  rel.split(",')(2),
  rel.split(",")(3).toInt,
  rel.split(",")(4))
 }).toDF

1 个答案:

答案 0 :(得分:0)

您在以下行中有错误

rel.split(",')(2),

您使用了'代替"