Viewing 1 post (of 1 total)
  • Author
  • #6502

    I’m trying to use flatMap in my code and was getting different result in spark and Scala. Below is the result which I,m getting

    scala> val x = result.flatMap {line => {val xml = XML.loadString(line); xml.attribute(“Title”) }}

    scala> x.take(2)
    res3: Array[Seq[scala.xml.Node]] = Array(How can I do simple machine learning without hard-coding behavior?, What open-source books (or other materials) provide a relatively thorough overview of data science?)

    Here I m getting array of string , while in python I am getting array of character.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.