I have a using the pipe function in spark RDD like this:
val custPrdRep = custPrdGrp.
pipe("sed s/CompactBuffer//g").
pipe("sed 's/\\], \\[//g'")
everything works except for the last pipe function...
I dont' get any results back when doing
custPrdRep.collect
in shell, this does work though:
$ echo "], [a" | sed 's/\\], \\[//g'
a
If I try it this way,
pipe("sed 's/\], \[//g'")
I get this error:
scala> val custPrdRep = custPrdGrp.pipe("sed s/CompactBuffer//g").pipe("sed s/|,/|/g").pipe("sed 's/\], \[//g'")
<console>:1: error: invalid escape character
val custPrdRep = custPrdGrp.pipe("sed s/CompactBuffer//g").pipe("sed s/|,/|/g").pipe("sed 's/\], \[//g'")
^
<console>:1: error: invalid escape character
val custPrdRep = custPrdGrp.pipe("sed s/CompactBuffer//g").pipe("sed s/|,/|/g").pipe("sed 's/\], \[//g'")
am I escaping the right characters in the right way?