![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hadoop
码基
码基
展开
-
定期删除分区表数据
#!/bin/bashts=$(date +%s%3N)list="/tmp/table2drop"touch $listecho > $listdeclare -A tbl_retentiondbs=$(hive -S -e "show databases" | grep -i -v -e 'default' -e 'database_name' -e 'tmp')for db in $dbs; do tbls=$(hive -S -e "show tables in原创 2021-05-14 12:53:33 · 380 阅读 · 0 评论 -
cpu使用率 内存使用率 磁盘使用率计算方法
原创 2021-04-20 09:44:01 · 1152 阅读 · 0 评论 -
如何查看 orc 文本
orc文本只能通过sqlContext读取val orcfile="/user/hive/warehouse/dos.db/gmall/partitions=2019-11-27/003255_0"val df = sqlContext.read.format("orc").load(orcfile)df.take(10)原创 2019-10-28 19:15:58 · 1685 阅读 · 0 评论 -
Getting to Grips with ZooKeeper(Zookeeper入门必备,深入浅出)
The previous chapter discussed the requirements of distributed applications at a high level and argued that they often have common requirements for coordination. We used the master-worker example, whi...翻译 2019-08-04 14:31:25 · 398 阅读 · 0 评论 -
hive 留存率 计算
定义留存率:某天活跃用户,在之后几天是否活跃,一日留存率就是用户注册后第二天仍然活跃,以此类推,三日留存率,七日留存率。任务:计算某段时间内注册的用户的一日留存率,三日留存率和七日留存率。建表use default;show tables;create table register_tbl(user_id string,register_date string)row for...原创 2019-07-30 12:14:41 · 2424 阅读 · 0 评论 -
hive 随机抽样 实用,有助于快速分析数据分布情况和可能的数据倾斜
Sampling Syntax 抽样语法Sampling Bucketized Table 分桶表抽样table_sample: TABLESAMPLE (BUCKET x OUT OF y [ON colname])The TABLESAMPLE clause allows the users to write queries for samples of the data instead...翻译 2019-07-06 10:13:58 · 1047 阅读 · 0 评论 -
HBase整理
Table有很多行组成。RowHBase的行由行键和一个或多个包含值列组成。行按照字典顺序排序。行键的设计原则是:相关的行存储位置应当尽量接近。如果使用域名作为行键,你可能需要把域名反过来存储,这样所有Apache的域名都会彼此相邻。Column由列族和列限定名组成,两者通过:冒号分隔。Column Family列族在物理上并置了一组列和值。每一个列族都有一系列存储特性可以设置,比如...翻译 2019-07-10 22:18:16 · 354 阅读 · 0 评论 -
Spark 结构化API——基础操作
Spark 结构化API——基础操作基本概念DataFrame:分布式,表格形式,行和列的集合;每一列的行数必须相同;列有特定的类型,列类型对所有行都一致。Schema:定义DataFrame所有列的名字和类型。以下是如何查询一个结构化数据的schema(spark类型推断):// in Scalaspark.read.format("json").load("/data/flig...原创 2019-07-14 13:52:47 · 395 阅读 · 0 评论 -
不好记的hadoop操作指令
[hadoop@hadoop01 ~]$ hdfs haadmin -getServiceState nn1standby查看namenode所处状态原创 2019-06-10 16:19:06 · 108 阅读 · 0 评论 -
偶然遇到的问题:删除hadoop中带空格的目录
[hadoop@hadoop01 ~]$ hadoop fs -ls /19/06/10 09:14:19 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicableFound 5 itemsdrw...原创 2019-06-10 09:25:13 · 844 阅读 · 0 评论 -
大数据maven依赖管理
学习笔记<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="htt...原创 2019-06-13 21:32:04 · 426 阅读 · 3 评论 -
hadoop 每个节点上最大的容器数多少
学习笔记,来自百知道hadoop 每个节点上最大的容器数多少这个看你的yarn怎么设置了,容器数据与cpu核数和内存大小都有关系,比如说下面这个配置:yarn.nodemanager.resource.cpu-vcores16yarn.scheduler.minimum-allocation-vcores1yarn.nodemanager.resource.memory-mb300...转载 2019-06-13 15:15:41 · 979 阅读 · 0 评论 -
各种排序方法的代码及优缺点
结论:**数据量大的情况下,冒泡、插入和希尔排序都过于缓慢;冒泡基本不用,插入适合小数据量排序,希尔排序适合中等数据量排序****归并排序会有大量时间浪费在临时数组内存的操作上,降低了排序速度;而且为了存储临时数组,内存开销远远大于快速排序****HadoopQuickSort算法复杂,一般情况下速度略慢于QuickSort****但是HadoopQuickSort的最大优势在于处理有大量重复数据的情况,在第4次试验每个元素重复10次,HadoopQuickSort的排序速度就快原创 2019-05-30 14:40:17 · 490 阅读 · 0 评论