- 博客(53)
- 资源 (2)
- 收藏
- 关注
原创 hive周日期处理
--本周星期几select if(pmod(datediff('2020-07-08', '1920-01-01') - 3, 7)='0', 7, pmod(datediff('2020-07-08', '1920-01-01') - 3, 7));--一年的第几周,跨年的周算在周天数比较多的年份select year(date_sub(next_day('2021-01-01','mo'),4))*100+weekofyear('2021-01-01');--本周周一日期select d.
2020-07-08 10:46:03
843
原创 java 大根堆
PriorityQueue<Integer> maxHeap = new PriorityQueue<Integer>(k, new Comparator<Integer>() { public int compare(Integer o1, Integer o2) { return o2.compareTo(o1); }});
2020-06-11 17:17:32
218
原创 scala option应用
--模式匹配val a:Option[Int] = Some(5)a match {case Some(s) => println(s)case None => print("None")}
2020-05-25 17:18:34
109
原创 链表定义
public class ListNode { int val; ListNode next; ListNode(int x) { val = x; }}
2020-05-25 14:19:50
174
原创 excel常用函数
--excel转时间格式=TEXT((LEFT(B2,10)+8*3600)/86400+70*365+19,"yyyy-MM-DD HH:mm:ss")
2020-05-23 15:30:57
454
原创 maven打包无pom项目命令
mvn install:install-file -Dfile=D:\Project\hello.jar -DgroupId=com.hello.udf -DartifactId=hello -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true
2020-05-23 11:40:39
1033
原创 spark-shell启动和退出
--启动spark-shell --master yarn --deploy-mode client \ --queue queue \ --driver-memory 1G --executor-memory 6G --executor-cores 4 \ --num-executors 30 --退出:quit
2020-05-23 11:38:53
802
原创 hive创建表
--hive创建表use database;drop table hello;create external table if not exists hello(a string,b string,c string)partitioned by (date string)row format delimited fields terminated by '\001' stored as sequencefilelocation 'base_path/hello';
2020-05-23 11:13:56
342
原创 shell时间
#获取几个月前对应的日期month=`date -d "$date -$num month" +"%Y%m%d"`#获取几个月前对应的月份first=`date -d "$date" +"%Y%m"`month=`date -d "${first}01 -$num month" +"%Y%m"`#获取几天前的日期day=`date -d "$date -$num days" +"%Y%m%d"`...
2020-05-23 11:03:22
227
原创 scala 时间
/** * 获取完整时间 * * @return */ def fullTime: String = { val today = new Date val f = new SimpleDateFormat("yyyyMMddHHmmss") f.format(today) } /** * 获取天时间 * * @return */ def dayTime: String = { val t...
2020-05-23 10:44:49
557
原创 省份简称
"京"->"北京市""津"->"天津市""沪"->"上海市""渝"->"重庆市""蒙"->"内蒙古自治区""新"->"新疆维吾尔自治区""藏"->"西藏自治区""宁"->"宁夏回族自治区""桂"->"广西壮族自治区""港"->"香港特别行政区""澳"->"澳门特别行政区""黑"->"黑龙江省""吉"->"吉林省""辽"->"辽宁省""晋"->"山西省""冀"->"河北省""青"-&
2020-05-23 10:35:51
743
原创 hive常用参数优化
--中间结果压缩set hive.exec.compress.intermediate=true;set mapred.map.output.compression.codec=org.apache.hadoop.io.compress.SnappyCodec;--sequeuencefile文件输出结果压缩set hive.exec.compress.output=true;set io.seqfile.compression.type=block;set mapred.output.com.
2020-05-23 10:27:19
275
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅