
大数据技术笔记
hadoop spark
咖啡豆丁
这个作者很懒,什么都没留下…
展开
-
pyspark 第三方依赖包
spark-submit \--master yarn \--deploy-mode cluster \--driver-memory 1g \--num-executors 1 \--queue default \--conf spark.yarn.dist.archives=hdfs:///user/xxx/conda_env.zip#python36 \--conf spark.pyspark.driver.python=./python36/conda_env/bin/python \原创 2021-09-13 10:47:52 · 793 阅读 · 0 评论 -
yarn日志查看
yarn logs -applicationId application_id > log 2>&1原创 2021-08-18 13:59:55 · 248 阅读 · 0 评论 -
java 二维数组排序
Arrays.sort(envelopes, new Comparator<int[]>() { public int compare(int[] o1, int[] o2) { if(o1[0] == o2[0]){ // 若俩数组的第一个元素相等,则比较它们的第二个元素 return o1[1] - o2[1]; }else { // 若俩数组的第一个元素不相等,则按从小到大的顺序...原创 2021-08-17 20:20:06 · 160 阅读 · 0 评论 -
linux 常见几个日期操作
#获取几天前的日期date -d "20210812 -3 days" +"%Y%m%d"#获取几个月前对应的日期date -d "20210812 -3 month" +"%Y%m%d"#获取几个月前对应的月份first=`date -d "20210803" +"%Y%m"`month=`date -d "${first}01 -3 month" +"%Y%m"`原创 2021-08-12 10:56:21 · 167 阅读 · 0 评论 -
linux当前路径
script_dir=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)原创 2021-08-10 15:13:13 · 133 阅读 · 0 评论 -
python spark 提交模板
spark-submit \--master yarn \--deploy-mode mode\--driver-memory 2g \--num-executors 30 \--executor-memory 6G \--executor-cores 4 \--conf spark.shuffle.service.enabled=true \--conf spark.dynamicAllocation.enabled=true \--conf spark.dynamicAllocatio原创 2021-08-10 10:32:46 · 147 阅读 · 0 评论 -
pyspark启动
pyspark --master yarn \--deploy-mode client \--conf spark.default.parallelism=240 \--queue queue\--driver-memory 2G \--executor-memory 6G \--executor-cores 4 \--num-executors 30原创 2021-05-26 15:29:03 · 886 阅读 · 0 评论 -
pytorch docker GPU环境安装
一.确保nvidia-docker安装查看系统版本root@3a7dee2ecfb3:/# cat /etc/issueUbuntu 16.04.6 LTS \n \l切换docker镜像systemctl daemon-reloadsystemctl restart docker查看cuda和cudnn版本[root@bogon pytorch]# cat /usr/local/cuda/version.txtCUDA Version 9.1.85[root@bogon pytor.原创 2021-03-11 20:41:30 · 370 阅读 · 0 评论 -
Java变量大小
原创 2021-03-11 20:29:34 · 437 阅读 · 0 评论 -
Tensorflow读取数据流
原创 2021-03-11 20:18:45 · 224 阅读 · 0 评论 -
AI平台虚拟环境搭建流程
环境需求:jupyterhub需要3.5环境以上tensorflow 3.5环境以上一、使用tensorflow/tensorflow:1.7.0-gpu-py3 docker镜像启动容器,目的:显卡驱动的安装容器名称为 ai_platform端口映射为 8008:8000 jupyterhub端口端口映射为 6008:6006 tensorboard端口使用 nvidia-docker软件共享目录映射 /ai_share/pr...原创 2021-03-11 20:07:41 · 863 阅读 · 0 评论 -
深度学习在图像领域实践的流程及思考
1.需求的提出 业务需求的提出,需要明确需求的价值,需求的背景和应用的场景以及需求方对于最后结果的大概期望。2.数据集的构建 数据集的来源数据分为两种情况:其一、是预定义收集的数据,是指在产品的设计初期,即考虑到下游对数据的使用,所以对数据的收集的格式进行了一定的规范,比如图像的大小,识别目标的位置,识别目标的图像的占比等。其二、是未预定义收集的数据,即是产品设计初期,未考虑到数据的相关问题,造成收集的数据质量无法保证。 大部分要构建数据集的源数据一般都是...原创 2021-03-10 19:16:25 · 366 阅读 · 0 评论 -
scala实现continue
import util.control.Breaks._object BreakableTest extends App{ val sample = List(1,2,3,4,5) for(j <- sample){ breakable{ if(j==2 || j == 4 ) { break() } println(s"打印的值为:$j") } }}结果为:打印的值为:1打印的值为:3打印的值为:5.原创 2020-12-24 13:39:09 · 301 阅读 · 0 评论 -
hive表随机采样
select * from test.hello distribute by rand() sort by rand() limit 200;原创 2020-12-18 14:38:01 · 223 阅读 · 0 评论 -
hive 关闭map join 优化
大小表关联,默认map join,申请本地内存巨大,导致报错退出Starting to launch local task to process map join; maximum memory = 477626368Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapredLocalTask关闭map join 即可set hive.auto.convert.join=false;...原创 2020-12-18 13:57:30 · 2335 阅读 · 0 评论 -
matplotlib科学计数法
def formatnum(x, pos): return '$%.1f$x$10^{4}$' % (x/10000)from matplotlib.ticker import FuncFormatterformatter = FuncFormatter(formatnum)ax1.yaxis.set_major_formatter(formatter)原创 2020-12-17 19:43:33 · 1180 阅读 · 0 评论 -
hive时间戳转日期
--毫秒转日期select from_unixtime(cast(1607966692000/1000 as bigint),'yyyy/MM/dd HH:mm:ss');原创 2020-12-17 14:50:48 · 1659 阅读 · 0 评论 -
大数据任务添加名称
sqoop--mapreduce-job-name 'hello'hiveset mapred.job.name=hello;MR-D mapreduce.job.name=hello;原创 2020-12-11 19:24:47 · 377 阅读 · 0 评论 -
Linux文本对比常用命令
diff b.txt a.txt -y -W 50comm a.txt b.txt -1 -3原创 2020-12-11 19:16:25 · 216 阅读 · 0 评论 -
idea常用快捷键
一、Ctrl 快捷键Ctrl + F 在当前文件进行文本查找Ctrl + R 在当前文件进行文本替换Ctrl + Z 撤销Ctrl + Y 删除光标所在行 或 删除选中的行Ctrl + X 剪切光标所在行 或 剪切选择内容Ctrl + C 复制光标所在行 或 复制选择内容Ctrl + D 复制光标所在行 或 复制选择内容,并把复制内容插入光标位置下面Ctrl + E 显示最近打开的文件记录列表Ctrl + N 根据输入的 名/类名 查找类文件Ctrl + / 释光标所在行代码,会根据当前原创 2020-12-11 19:14:58 · 84 阅读 · 0 评论 -
spark 聚合函数类型转换
val zeroValue = collection.mutable.Set[Row]()val aggStopRDD = stopPairRDD.aggregateByKey(zeroValue)((set,v) => set += v, (setOne,setTwo)=> setOne ++= setTwo)原创 2020-09-25 15:51:19 · 231 阅读 · 0 评论 -
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 · 861 阅读 · 0 评论 -
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 · 813 阅读 · 0 评论 -
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 · 351 阅读 · 0 评论 -
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 · 284 阅读 · 0 评论