当前位置: 首页 > news >正文

网站怎么做中英文切换石家庄网络推广公司

网站怎么做中英文切换,石家庄网络推广公司,网站功能配置,北京建设网站的公司兴田德润优惠之前实习写的笔记#xff0c;上传留个备份。 1. 使用docker-compose快速搭建Hive集群 使用docker快速配置Hive环境 拉取镜像 2. Hive数据类型 隐式转换#xff1a;窄的可以向宽的转换显式转换#xff1a;cast 3. Hive读写文件 SerDe:序列化#xff08;对象转为字节码…之前实习写的笔记上传留个备份。 1. 使用docker-compose快速搭建Hive集群 使用docker快速配置Hive环境 拉取镜像 2. Hive数据类型 隐式转换窄的可以向宽的转换显式转换cast 3. Hive读写文件 SerDe:序列化对象转为字节码、反序列化 3.1 hive读写文件流程 反序列化将文件映射为表 调用inputFormat转为key,value类型然后进行反序列化。 3.2 SerDe语法 row format 指定序列化方式和分割符 Delimited:默认序列化方式Json:改变序列化方式 hive 默认分割符\001 4. 存储路径 默认存储/usr/hive/warehouse指定存储路径location hdfs_path 5. 练习 创建表并加载数据。 use ods; create external table hero_info_1(id bigint comment ID,name string comment 英雄名称,hp_max bigint comment 最大生命 ) comment 王者荣耀信息 row format delimited fields terminated by \t;将文件上传到相应路径只要指定好分割符就可以。 hadoop fs -put test1.txt /usr/hive/warehouse/test.db/hero_info_1map类型 create table hero_info_2(id int comment ID,name string comment 英雄名字,win_rate int comment 胜率,skin mapstring, int comment 皮肤价格 -- 注意map分割类型 ) comment 英雄皮肤表 row format delimited fields terminated by , -- 指定字段分割符 collection items terminated by - -- 指定集合元素之间分割符 map keys terminated by :; -- 指定map元素kv之间的分割符hadoop fs -put test2.txt /usr/hive/warehouse/test.db/hero_info_26. 指定路径使用 create table t_hero_info_3(id int comment ID,name string comment 英雄名字,win_rate int comment 胜率,skin mapstring, int comment 皮肤价格 -- 注意map分割类型 ) comment 英雄皮肤表 location /tmp; ​ select * from t_hero_info_3; 7. 内部表和外部表 外部表删除不会删除hdfs文件 一般都用外部表 drop table t_hero_info_3; -- 文件也被删除9. 分区表 上传多个文件 发现sql执行很慢因为where需要进行全表扫描所以效率慢 但是我们是根据射手类型来进行分类的因此可以只扫描这一个分区的数据 分区字段不能是表中已经存在的字段 create external table t_hero_info_1(id int comment ID,name string comment 名字 ) comment 英雄信息 partitioned by (role string) row format delimited fields terminated by \t;静态分区 load data local inpath /root/a.txt into table t_hero_info_1 partition(rolesheshou); ​ ​ -- 分区扫描 role是分区字段不用全表扫描 select count(*) from t_hero_info_1 where role sheshou and hp_max 6000; ​10. 多重分区表 一般为双重分区表 create external table t_hero_info_1(id int comment ID,name string comment 名字 ) comment 英雄信息 partitioned by (province string, city string); -- 分区字段存在顺序 ​ -- 分区1 load data local inpath /root/a.txt into table t_hero_info_1 partition(provincebeijing,citychaoyang); -- 分区2 load data local inpath /root/b.txt into table t_hero_info_1 partition(provincebeijing,cityhaidian); -- 多重分区 load data local inpath /root/b.txt into table t_hero_info_1 partition(provinceshanghai,citypudong);11. 动态分区 根据字段值来进行动态分区使用insertselect步骤创建完分区表后存在一个分区字段role这时我们使用insertselect方法将原先表的数据插入到分区表中。 -- 原始数据表 t_all_hero -- 分区表 t_all_hero_part ​ -- role这里是分区字段role_main是我们给指定的分区类型 insert into table t_all_hero_part partition(role) select tmp.*, tmp.role_main from t_all_hero tmp;在企业中一般根据日期来进行分区表。注意分区的字段不能是已有的字段即字段名字不能重复分区的字段是个虚拟的字段并不存在于底层当中 12. 分桶表 来进行优化查询 分桶是将一个文件分为若干个文件 规则 将文件中数据哈希从而分到不同桶中。 一般是根据主键来进行分桶 创建一个普通的表然后上传数据通过insetselect来加载分桶 -- 创建分桶表 create table test.t_state_info() clustered by(state) into 5 buckets; -- state一定是表中已有的字段 ​ -- 插入数据 insert into t_state_info_bucket select * from t_state_info;好处 可以基于分桶字段来查找不需要进行全表过滤 join时减少笛卡尔积数量 窗口函数 over后返回的表行数不变 解析json get_json_object:一次只能解析一个字段
http://www.pierceye.com/news/772616/

相关文章:

  • 网站页面可以用什么框架做wordpress 自动 图片大小
  • 百度小程序可以根据网站的要求做吗网站建设评分细则
  • 团购模板网站廉洁长沙网站
  • 湖州建设网站制作多多进宝cms网站建设
  • 自己做网站有哪些方法呢深圳网站设计张兵
  • 网站开发技术的选择wordpress 标签 中文
  • 建设速干裤移动网站公司logo注册
  • 中山网站建设找阿江欢迎页网页设计作品欣赏
  • seo是东莞企业网站排seo网站制作与管理技术...
  • 哪里有建设好的网站做网站用哪个预装系统
  • h5技术建设网站的知识wordpress+主题+欣赏
  • 如何优化网站排名淘宝客 备案 网站名称
  • 网站后台管理系统源代码沧州市宇通网站建设公司
  • 郴州网站设计公司阜新网站设计
  • 成都网站制作中国互联个人做电影网站赚钱吗
  • 如何做自己的影视网站惠州惠城网站建设
  • 温州网站推广外包推推蛙网站建设
  • 北京百度网站排名优化四川公共资源交易网招标网
  • 上海网站制作商多用户网上商城
  • 四川建设网电子招投标网站莱芜金点子电话
  • 深圳科技网站建设网站怎么做跳站
  • 做网站需要多少人全国物流货运平台
  • 温州建网站用自己的电脑做网站
  • 综合性门户网站有哪些高端网站建设 房产
  • 百度做的网站能优化吗如何在jsp上做网站页面代码
  • 广州市品牌网站建设公司营销型网站开发推广
  • 甜品网站首页设计用php做的网站模版
  • 怎样做企业的网站百度下载安装免费版
  • 常州市网站优化汕头网站建设和运营
  • wordpress 同分类评论调用seo排名是什么