![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Scala方法
文章平均质量分 63
为了九亿少女的期待
各路大牛挥挥手
展开
-
Scala中的二分查找法
def binarySerch(lines:Array[(Long,Long,String)],ip:Long):Int = { var low = 0 var high = lines.length-1 while (low <= high){ val middle = (low+high)/2 if((ip >= lines(middle)._1) &...原创 2018-08-29 21:59:40 · 1417 阅读 · 2 评论 -
用Spark写出的内容存储到MySQL中
def data2MySQL (it: Iterator[(String,Int)])={ //一个迭代器代表一个分区,分区中有多条数据 //先获得一个JDBC连接 val conn: Connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/bigdata?characterEncoding...原创 2018-08-29 22:01:48 · 586 阅读 · 0 评论