我有一个数据框df,其中有两列是这样的。+-----+------------------+|x|y|+-----+------------------+|0.0|{12,16,17,18,19}||0.0|{18,16,17,18,19}||0.0|{15,16,67,18,19}||0.0|{65,16,17,18,19}||0.0|{9,16,17,18,19}||1.0|{12,16,17,28,39}||0.0|{24,16,17,28,19}||0.0|{90,16,17,18,29}||1.0|{30,16,17,18,19}||1.0|{28,16,17,18,19}|
我是Spark的新手。对于我的项目,我需要合并来自不同端口上不同流的数据。为了测试我做了一个练习,目的是打印来自不同端口的流的数据。下面你可以看到代码:objecthello{defmain(args:Array[String]){valssc=newStreamingContext(newSparkConf(),Seconds(2))vallines9=ssc.socketTextStream("localhost",9999)vallines8=ssc.socketTextStream("localhost",9998)lines9.print()lines8.print()ssc