栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

考试知识点整理

考试知识点整理

hadoop   start-all.sh
zkS  zkServer.sh start
hive2    hive --service hiveserver2
        hive --service metastore
hbase  start-hbase.sh  hbase shell
zepplin zeppelin-daemon.sh start

%sh
hdfs dfs -rm -r /app
hdfs dfs -mkdir -p /app/data/exam
hdfs dfs -put /opt/returned_goods_log_7-9.csv /app/data/exam
hdfs dfs -cat /data../*.csv  |wc -l


hbase 创建
create_namespace 'exam'
create 'exam:sales','statisitcs'

hive 外部表 
create database exam
create external table exam.sale_service(
    
)
row format delimited fields terminated by ','

row format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
with serdeproperties 
(
    'separatorChar' = ',',  
    'quoteChar' = '"',
    'escapeChar'= '\'
)

location '/app/data/exam'
tblproperties('skip.header.line.count'='1')     ---去首行

hive 映射 hbase
create external table exam.hbase_sale_service(
key string,
service int
)
STORED BY 'org.apache.hadoop.hive.hbase.HbaseStorageHandler'    
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,result:service,result:praise")    
TBLPROPERTIES("hbase.table.name" = "exam:sales")


数据导入hive映射表中
with
t1 as (select continent,countryName,recordDate,/confirm/iedIncr,row_number() over(partition by recordDate order by cast(confirmedIncr as int) desc) rank from ex_exam_record),
t2 as (select continent,countryName,recordDate,confirmedIncr from t1 where rank=1 order by recordDate)
insert into ex_exam_covid19_record select concat(continent,recordDate) key,countryName maxIncreaseCountry,confirmedIncr maxIncreaseCount from t2

hbase查看
scan 'exam:sales',{LIMIT=>10}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/682353.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号