title: How to parse Proto Buf Mesage in Spark Streaming received from Kafka Stream in Spark 1.6
body: <p>Hi I am working on a Spark Streaming project. In this project I to have Parse Data received from Kafka Stream (Proto Buf Message)</p>
  
  <p>I don't have any idea about parsing Proto Buf Mesage in Kafka. </p>
  
  <p>I am trying to understand below code to get started with parsing protobuf message.</p>
  
  <p>def main(args : Array[String]) {</p>
  
  <pre><code>val spark = SparkSession.builder.
    master("local")
    .appName("spark session example")
    .getOrCreate()
  
  import spark.implicits._
  
  val ds1 = spark.readStream.format("kafka").
    option("kafka.bootstrap.servers","localhost:9092").
    option("subscribe","student").load()
  
  val ds2 = ds1.map(row=&gt; row.getAs[Array[Byte]]("value")).map(Student.parseFrom(_))
  
  val query = ds2.writeStream
    .outputMode("append")
    .format("console")
    .start()
  
  query.awaitTermination()
  </code></pre>
  
  <p>}</p>
  
  <p>Can someone please provide me some example to how to parse proto buf message step by step ? 
  I just need some reference material of how to consume it in spark streaming application. </p>