大数据技术
文章平均质量分 68
你那谁
这个作者很懒,什么都没留下…
展开
-
scala 继承extends,with浅见
近来学习scala,在继承这一块有一点小小的发现,遂记录下来,以备以后复习之用。1,当with放在子类定义的后面时,输出的结果为:300和150class Animal { val weight = 100 val doubleWeight = 2 * weight}class Tiger extends { override val weight: Int = 150} wit...原创 2018-02-10 10:16:09 · 5825 阅读 · 0 评论 -
新手速学之spark快速读写mysql以及解决中文乱码问题
1.spark快速读取mysqlval spark = SparkSession.builder.appName("bidInfo").getOrCreate()val sc = spark.sparkContextval properties = new Properties()properties.put("user","root")properties.put("passwo原创 2018-02-06 11:21:42 · 5085 阅读 · 1 评论 -
python读取mysql
1.python读取mysql#!/usr/bin/python3import pymysql# 打开数据库连接db = pymysql.connect(host="192.138.7.104",user="root",password="root",db="dbname",port=port,charset='utf8')# 使用 cursor() 方法创建一个游标对象 cu原创 2018-02-06 11:40:12 · 736 阅读 · 0 评论 -
去除spark运行信息
在平时用spark时,经常会有一些内部的操作信息出现在操作台,往往会将我们自己的输出信息淹没在这些信息中如下所示,很是麻烦。18/02/06 11:50:29 INFO BlockManagerMaster: Registering BlockManager BlockManagerId(driver, 192.168.159.1, 6423)18/02/06 11:50:29 INFO原创 2018-02-06 12:27:22 · 790 阅读 · 0 评论