title: Exception in thread "main" scala.ScalaReflectionException: <none> is not a term
body: <p>I am trying to write a Seq[(String, Double)] data from Spark to Cassandra DB, e.g., Seq(("re", 1.0), ("im", 2.0)) to Cassandra.  But there is an exception as follows:</p>
  
  <pre><code>Exception in thread "main" scala.ScalaReflectionException: &lt;none&gt; is not a term
      at scala.reflect.api.Symbols$SymbolApi$class.asTerm(Symbols.scala:199)
      at scala.reflect.internal.Symbols$SymbolContextApiImpl.asTerm(Symbols.scala:84)
  .....
  </code></pre>
  
  <p>The Spark code is as follows:</p>
  
  <pre><code>def main(args: Array[String]) {
  
     //  omit some code
  
      val rawTRLStream = KafkaUtils.createDirectStream[String, Array[Byte], StringDecoder, DefaultDecoder](ssc, kafkaParams, topics)
  
      val parsedTRLStream = rawTRLStream.map {
  
          case (_, inputStreamData) =&gt; 
  
             //--- do somthing next 
             //....
  
  
            val seq : Seq[(String, Double)]= Seq (("re", 1.0), ("im", 2.0))  
            seq
      }
  
      implicit val rowWriter = SqlRowWriter.Factory   // This is a suggestion on the web, but it does not help on this problem.
  
      parsedTRLStream.saveToCassandra("simple_avro_data", "simple_avro_data")
  
      //Kick off
      ssc.start()
  
      ssc.awaitTermination()
  
      ssc.stop()
  }
  </code></pre>
  
  <p>The Cassandra schema is as follows:</p>
  
  <pre><code>CREATE TABLE simple_avro_data (
     re double,
     im double,
     PRIMARY KEY ((re), im)
  ) WITH CLUSTERING ORDER BY (im DESC);
  </code></pre>
  
  <p>I also try next suggestion from <a href="https://stackoverflow.com/questions/33811881/scala-scalareflectionexception-none-is-not-a-term">scala.ScalaReflectionException: &lt;none&gt; is not a term</a></p>
  
  <pre><code>val seq = (("re", 1.0), ("im", 2.0))          
  </code></pre>
  
  <p>This removes the exception  "....  is not a term", but it introduces another exception:</p>
  
  <pre><code>Com.datastax.spark.connector.types.TypeConversionException: Cannot convert object (re,1.0) of type class scala.Tuple2 to java.lang.Double.
  </code></pre>
  
  <p>Does anyone know how to solve the problem?</p>
  
  <p>Thanks,</p>