title: Some.asInstanceOf[T] or Some.get.asInstanceOf[T] for json
body: <p>I have rdd with json rows:</p>
  
  <pre><code>val jsons = sc.textFile("hdfs://" + directory + "articles_json/*/*").flatMap(_.split("\n")).
                          map(x =&gt; JSON.parseFull(x))
  </code></pre>
  
  <p>Each json has field "dc:title" and i want to create rdd with these titles and with indexes.</p>
  
  <pre><code>val titles_rdd = jsons.filter(x =&gt; x.isDefined).
        map(x =&gt; x.get.asInstanceOf[Map[String, Any]].
        get("dc:title").get.asInstanceOf[String]).zipWithIndex()
  </code></pre>
  
  <p>But, i don't understand, should i use <strong>.get</strong> in <code>x =&gt; x.get.asInstanceOf</code> in map, or just <code>x =&gt; x.asInstanceOf</code>? And the same question about <strong>.get</strong> after <code>get("dc:title")</code>?</p>