Iterate Over a tuple

前端 未结 4 1939
囚心锁ツ
囚心锁ツ 2020-12-16 21:49

I need to implement a generic method that takes a tuple and returns a Map Example :

val tuple=((1,2),((\"A\",\"B\"),(\"C\",3)),4)

I have b

4条回答
  •  情歌与酒
    2020-12-16 22:34

    This works for me. tranform is a tuple consists of dataframes

    def apply_function(a: DataFrame) = a.write.format("parquet").save("..." + a + ".parquet")
    transform.productIterator.map(_.asInstanceOf[DataFrame]).foreach(a => apply_function(a))
    

提交回复
热议问题