zeppelin表单:在Spark中动态加载项目

时间:2017-06-24 17:33:51

标签: apache-spark apache-zeppelin

如何在Apache Zeppelin表单上动态加载项目?

%spark
println("Hello "+z.select("day", Seq(("1","mon"),
                                    ("2","tue"),
                                    ("3","wed"),
                                    ("4","thurs"),
                                    ("5","fri"),
                                    ("6","sat"),
                                    ("7","sun"))))

我从SQL Spark请求中检索一个字符串数组,我想用数组作为输入创建z.select

1 个答案:

答案 0 :(得分:0)

找到解决方案......我是Scala的初学者,我不知道如何创建Array [(String,String)] object

//Create an array
val myArray = new Array[(String, String)](sizeofArray)
//Pass array to z.input form as Iterable
println("Hello "+z.select("day", myArray.toIterable))

马克西姆