ezoic

Monday, June 5, 2017

Scala Saprk loop through a data frame



http://permalink.gmane.org/gmane.comp.lang.scala.spark.user/30128

You could call *collect()* method provided by DataFram API. This will give
you an *Array[Rows]*. You could then iterate over this array and create
your map. Something like this :

val mapOfVals = scala.collection.mutable.Map[String,String]()
var rows = DataFrame.collect()
rows.foreach(r => mapOfVals.put(r.getString(0), r.getString(1)))
println("KEYS : " + mapOfVals.keys)
println("VALS : " + mapOfVals.values)
 
 



1 comment:

  1. Windows 10 Activator or KMSpico is a similar apparatus that is utilized to initiate Microsoft Products, for example, Microsoft Office and Other Windows. This is the main free Software that is 100% sans bug and there is no infection or malware included.

    It is a renowned and very notable activator among the people as it furnishes you with the constant initiation notice.

    This instrument is 100% safe from the misrepresentation assurance and you will never get captured while utilizing it. Despite the fact that you get the framework updates of each window which encourages you to ensure your PC. As you realize that when you get the updates it will fix a few glitches, shield from infections and other new highlights include that update.


    windows 10 activator


    serial key

    windows 10 activator
    https://serialkeypatch.org/windows-10-activator-key/


    windows 8.1 activator
    https://serialkeypatch.org/windows-8-1-activator-product-key/


    windows 8.1 product key generator
    https://serialkeypatch.org/windows-8-1-product-key-generator/

    ReplyDelete

looking for a man

 I am a mid aged woman.  I was born in 1980. I do not have any kid. no complicated  dating before . I am looking for a man here for marriage...