How to write ascii null "\0" in spark

scala
bigdatalabs
spark

#1

Hi,

I’m trying a problem in which the output should be written as ascii null “\0”.

I have tried
x03.map(x=>x.productIterator.mkString("\0")).take(10).foreach(println)
(and)
x03.map(x=>x._1+"\0"+x._2).take(10).foreach(println)

The output doesn’t look as separated by “\0”

Can someone please explain how to write ascii null in the output.

Thanks,
Chaketh

Learn Spark 1.6.x or Spark 2.x on our state of the art big data labs

  • Click here for access to state of the art 13 node Hadoop and Spark Cluster