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

手机网站弹窗做app动态界面的网站有哪些

手机网站弹窗,做app动态界面的网站有哪些,600元做网站,百度广告投放技巧原生数据类型 准备数据 查看表信息 加载数据 查看数据 复杂数据类型-数组 准备数据 查看数据 ​优化 复杂数据类型-map 准备数据 查看数据 复杂数据类型-默认分隔符 准备数据 查看数据 原生数据类型 准备数据 -- 1 建库 drop database if exists db_1 cascade;…

        原生数据类型

准备数据

查看表信息

加载数据

查看数据

复杂数据类型-数组

准备数据

查看数据

​优化

复杂数据类型-map

准备数据

查看数据

复杂数据类型-默认分隔符

准备数据

查看数据


原生数据类型

准备数据

-- 1 建库
drop database if exists db_1 cascade;
create database if not exists db_1;
use db_1;-- 2 建表
create table tb_archer(id int comment "ID",name string comment "英雄名称",hp_max int comment "最大生命",mp_max int comment "最大法力",attack_max int comment "最高物攻",defense_max int comment "最大物防",attack_range string comment "攻击范围",role_main string comment "主要定位",role_assist string comment "次要定位"
)
comment '射手表'
row format delimited fields terminated by '\t'
;

查看表信息

-- 查看表的信息
desc db_1.tb_archer;-- 查看表的详细信息
desc formatted db_1.tb_archer;

加载数据

方式一:从本地加载到hdfs上

方式二:使用load命令将本地文件传到hdfs上

load data local inpath '/root/honor_of_kings/01_archer.txt' into table db_1.tb_archer_2;

方式三:使用load命令在hdfs上移动文件

-- 方式三:使用load命令将hdfs上的一个文件传到另一个目录下(这个是剪切效果,之前的文件将会没有)
load data inpath '/data/honor_of_kings/01_archer.txt' into table db_1.tb_archer_3;

hdfs没传之前

传之后

查看数据

select * from db_1.tb_archer;

复杂数据类型-数组

使用delimited关建字

row format delimited fields terminated by ',' :每个列之间分割
collection items terminated by '-':集合之间的元素分割
map keys terminated by ':' :键值对之间分割
lines terminated by '\n':每行数据分割

准备数据

-- 创建表
create table db_1.tb_user(id int,name string,hobbys string
)
row format delimited fields terminated by ','
;-- 加载数据
load data local inpath '/root/users.txt' into table db_1.tb_user;-- 查看数据-
select * from db_1.tb_user;

查看数据

通过制定分隔符转化成数组

-- 节选最后一列的爱好
selectid,name,hobbys,split(hobbys, '-'),split(hobbys, '-')[0],split(hobbys, '-')[1],split(hobbys, '-')[2]
from db_1.tb_user;
优化

加上delimited关建字,使用row format delimited来处理单分隔符问题

-- 创建表
create table db_1.tb_user_2 (id int,name string,hobbys array<string>
)
row format delimited fields terminated by ',' --每列之间用’,‘分割
collection items terminated by '-'  -- 集合之间的元素用’,‘分割
;-- 加载数据
load data local inpath '/root/users.txt' into table db_1.tb_user_2;-- 查看数据
selectid,name,hobbys,hobbys[0],hobbys[1],hobbys[2]
from db_1.tb_user_2;

 复杂数据类型-map

准备数据

-- 创建表
create table t_hot_hero_skin_price(id int,name string,win_rate int,skin_price map<string,int>
)
row format delimited fields terminated by ','
collection items terminated by '-'
map keys terminated by ':'  -- 键值对之间用':'分割
;-- 加载数据
load data local inpath '/root/honor_of_kings/02_hot_hero_skin_price.txt' into table t_hot_hero_skin_price;

查看数据

-- 查看全部数据
select * from t_hot_hero_skin_price;

指定数据:查看id=1的“大圣娶亲”和“至尊宝”的皮肤价格。

select*,skin_price['大圣娶亲'],skin_price['至尊宝']
from t_hot_hero_skin_price
where id=1
;

 

 复杂数据类型-默认分隔符

准备数据

-- 创建表
create table tb_team_ace_player(id int,team_name string,ace_player_name string
);-- 加载数据
load data local inpath '/root/honor_of_kings/03_team_ace_player.txt' into table db_1.tb_team_ace_player;

查看数据

select * from db_1.tb_team_ace_player;

 默认分隔符是^A

 

http://www.yayakq.cn/news/787425/

相关文章:

  • 中山市文联灯饰有限公司网站谁做的wordpress影视站主题
  • 中国电信网站备案流程沐风模板WordPress
  • 中国十大网络安全公司排名深圳网站seo公司
  • 勉费申请做网站ftp空间网站
  • 管庄地区网站建设政务中心网站自身建设
  • 域名备案 个人 网站基本信息查询天河低价网站建设
  • 网站改版建设方案wordpress ping大全
  • 中国铁路建设投资公司网站熊学军磁力搜索
  • 什么网站有加工外发做的天美影视传媒有限公司
  • 一站式网站建设比较好网页设计制作要求
  • 网站开发人员工资中国建设工程监理网站
  • 盐城营销网站建设开发软件都有哪些
  • 凡科建站相关链接移动应用开发技术学什么
  • 闵行做网站建设wordpress全功能主题
  • 帮做钓鱼网站会怎样wordpress英文版 菜单
  • 烟台网站制作策划wordpress 样式 code
  • 成品网站管理系统连云区住房和城乡建设局网站
  • 电子商务和网络营销哪个好整站优化的公司
  • 做网站什么码批量查询指数
  • 阿里云虚拟主机怎么建设网站心得网站建设
  • 自助式网站海珠区建网站
  • 石家庄网站建设机构买家乡的特产网站建设样本
  • ios7风格网站学校网站asp
  • 山东高端网站建设wordpress 主题开心版
  • 公司建设一个网站首页html简单网页案例
  • 公司主营业务网站建设交易链接
  • 成都医院做网站建设服装企业网站策划书
  • 重庆做网站团队山西推广网站建设
  • 做阿里网站wap购物网站源码
  • 盐城网站制作做html网站模板