title: Spark structured streaming read from kafka json encoding issue
body: <p>I struggle to read my JSON data in a kafka topic using Spark Structured Streaming.</p>
  
  <p>Context : </p>
  
  <p>I'm building a simple pipeline where I read data from a MongoDb (this db is frequently populate from another app) using kafka, then I want to get this data in Spark. </p>
  
  <p>For that I'm using Spark Structured Streaming which seems to work.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>import org.apache.spark.rdd
  import org.apache.spark.sql.avro._
  import org.apache.spark.sql.{Column, SparkSession}
  import org.apache.spark.sql.functions.from_json
  import org.apache.spark.sql.types.{ArrayType, DataTypes, StructType}
  import org.apache.spark.sql.functions.explode
  import org.apache.spark.sql.functions.schema_of_json
  object KafkaToParquetLbcAutomation extends App {
  
  
  
  
  
    val spark = SparkSession
      .builder
      .appName("Kafka-Parquet-Writer")
      .master("local")
      .getOrCreate()
    spark.sparkContext.setLogLevel("ERROR")
    import spark.implicits._
  
    val kafkaRawDf = spark
      .readStream
      .format("kafka")
      .option("kafka.bootstrap.servers",BROKER IP)
      .option("subscribe", "test")
      .option("startingOffsets", "earliest")
      .load()
  
    val testJsonDf = kafkaRawDf.selectExpr("CAST(value AS STRING)")
  
  
  
  
  
  
    //affichage des data
    val query = testJsonDf
      .writeStream
      .outputMode("append")
      .format("console")
      .queryName("test")
      .start()
      .awaitTermination()
  }
  </code></pre>
  
  <p>After reading those JSON data I want to make some transformation.</p>
  
  <p>Here start the problem, I can't parse the JSON data due to a strange encoding that I'm not able to decode.</p>
  
  <p>Therefore I can't go further on my pipeline.</p>
  
  <p>How I should get my data : </p>
  
  <pre><code>{
    "field 1" : "value 1 ", 
  }
  </code></pre>
  
  <p>(With many other field)</p>
  
  <p>How I actualy get the data : </p>
  
  <pre><code>VoituresXhttps://URL.fr/voitures/87478648654.htm�https://img5.url.fr/ad-image/49b7c279087d0cce09123a66557b71d09c01a6d2.jpg�https://img7.url.fr/ad-image/eab7e65419c17542840204fa529b02e64771adbb.jpg�https://img7.urln.fr/ad-image/701b547690e48f11a6e0a1a9e72811cc76fe803e.jpg
  </code></pre>
  
  <p>The issue might be in the delimiter or someting like.</p>
  
  <p>Can you please help me </p>
  
  <p>Thank You </p>