03 2018 档案
摘要:/** * Created by EX-CHENZECHAO001 on 2018-03-30. */class Chapter06 {}// 6 对象// 用对象作为单例或存放工具的方法// 类可以拥有一个同名的伴生对象// 对象可以扩展类或物质// 对象的apply方法通常用来构造伴生类的新实例
阅读全文
摘要:// 5.7 主构造器// 主构造器的参数直接旋转在类名之后class Person57(val name: String, val age: Int) { // 上边()中的内容就是主构造器的参数}class Person57_01(val name: String) { var age = 0
阅读全文
摘要:1 -- 查看系统用户 2 select Host,User,Password from mysql.user; 3 4 -- 创建一个远程用户 5 create user test identified by '123456'; 6 7 -- 分配权限 8 grant all privileges
阅读全文
摘要:import scala.collection.mutable.ArrayBuffer/** * Created by EX-CHENZECHAO001 on 2018-03-29. */class Chapter03 {}object Chapter03 { // 3.5 常用算法 val arr
阅读全文
摘要:/** * Created by EX-CHENZECHAO001 on 2018-03-29. */class Chapter05 {}// 类// 类中的字段自动带有getter方法和setter方法// 5.1 简单类和无参方法class Counter { private var value
阅读全文
摘要:// 2.1 条件表达式val x = 2val s = if (x > 0) 1 else -1if (x > 0) "positive" else -1// 返回值类型不一致,无法确定返回值的类型,所以返回Any类型// 2.2 语句终止var n = 2var r = 0if (n > 0)
阅读全文
摘要:### 7K+个表测试 ### shell处理,效率低,执行时间: 7m32.664s ### perl处理,效率超高,执行时间: 0m0.298s
阅读全文
摘要:// 4.1构造映射val scores = Map("Alice" -> 10, "Bob" -> 3, "Cindy" -> 8) // 不可更改值val scoresMu = scala.collection.mutable.Map("Alice" -> 10, "Bob" -> 3, "Ci
阅读全文
摘要:package chapter03 import org.apache.spark.sql.DataFrame import org.apache.spark.sql.hive.HiveContext import org.apache.spark.{SparkConf, SparkContext} /** * Created by chenzechao on 2017/12/21. ...
阅读全文
摘要:https://teddysun.com/486.html
阅读全文
摘要:1 进入hbase: hbase shell 2 进入HIVE: hive 3 4 hbase中建一张t_student_info表,添加两个列族 5 create 't_student_info','st1','st2' 6 7 hbase查看表结构 8 describe 't_student_info' 9 10 11 12 hive 创建外部表要使用EXTE...
阅读全文
摘要:select day -- 时间 ,date_add(day,1 - dayofweek(day)) as week_first_day -- 本周第一天_周日 ,date_add(day,7 - dayofweek(day)) as week_last_day -- 本周最后一天_周六 ,date
阅读全文
摘要:1 select 2 count(1) as cnt 3 from ( 4 select '0' as flag union all 5 select 'a' as flag union all 6 select null as flag 7 ) t0 8 where flag 0 9 ; 10 11 select 12 ...
阅读全文