![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
scala
我终于有blog了
菜鸟一只
展开
-
TOUR OF SCALA 通过混入(MIXIN)来组合类
当某个特质被用于组合类时,被称为混入。abstract class A { val message: String}class B extends A { val message = "I'm an instance of class B"}trait C extends A { def loudMessage = message.toUpperCase()}clas...原创 2018-12-05 17:00:42 · 138 阅读 · 0 评论 -
scala使用impilct参数
class StringIterator(s: String) extends AbsIterator { type T = Char private var i = 0 def hasNext = i < s.length def next() = { val ch = s charAt i i += 1 ch } object Stri...原创 2018-12-06 14:17:47 · 105 阅读 · 0 评论 -
java使用spark时类型转换
mysparkTest2 my = new mysparkTest2();SparkSession spark = SparkSession. builder(). master( "local" ). appName( "mytest" ).getOrCreate();Dataset<String> logData = spar...原创 2018-12-06 19:02:50 · 1168 阅读 · 0 评论 -
sparkSQL(版本2以后)
var spark = SparkSession.builder.master("local").appName("mytest").getOrCreate()//dataset -> rddvar dataset = spark.read.textFile("./test").cachevar result = dataset.rdd.map((a: String) => a...原创 2018-12-10 15:52:50 · 452 阅读 · 0 评论