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

南宁网站优化排名推广网站换空间wordpress

南宁网站优化排名推广,网站换空间wordpress,巩义网络推广公司,wordpress屏蔽外国ip目录 一、背景 二、准备测试数据 1.建表 2.造测试数据 三、操作 1.CTAS (1).无分区表测试 (2).分区表测试 2.LIKE (1).无分区表测试 (2).分区表测试 一、背景 有一张ori_…

目录

一、背景

二、准备测试数据

1.建表

2.造测试数据

三、操作

1.CTAS

(1).无分区表测试

(2).分区表测试

2.LIKE

(1).无分区表测试

(2).分区表测试


一、背景

有一张ori_table,想新建一张表new_table,保持跟ori_table一样的表结构,但是不复制ori_table的数据。

二、准备测试数据

1.建表

create table ori_table (
id   bigint,
col1 string,
col2 double
)comment '无分区原始表'
stored as orc;create table ori_table_partition (
id   bigint,
col1 string,
col2 double
)comment '有分区原始表'
partitioned by (dt string)
stored as orc;

2.造测试数据

insert into ori_table values (1,'哈哈',10.02);
insert into ori_table values (2,'嘿嘿',20.06);
insert into ori_table values (3,'嘻嘻',30.08);insert into ori_table_partition partition(dt='1') values (1,'哈哈',10.02);
insert into ori_table_partition partition(dt='2') values (2,'嘿嘿',20.06);
insert into ori_table_partition partition(dt='3') values (3,'嘻嘻',30.08);

三、操作

有2种办法

1.CTAS

(1).无分区表测试

--复制与ori_table表结构及表数据都一致的语句create table new_table as select * from ori_table;--只复制与ori_table表结构的语句
create table new_table as select * from ori_table where 1=0;

show create table new_table;   --执行看一下效果

 

select * from new_table;  --执行看一下数据量

 

由此得出结论,无分区表使用该语句可以满足需求!

(2).分区表测试

--复制与ori_table_partition表结构及表数据都一致的语句create table new_table_partition as select * from ori_table_partition;--只复制与ori_table表结构的语句
create table new_table_partition as select * from ori_table_partition where 1=0;

show create table new_table_partition;     --执行看一下效果

 

 这里看到表结构还是有些差异的,执行后将分区表建成了无分区表,分区字段创建成了普通字段。

select * from new_table_partition;   --执行看一下数据量

结论:

CTAS语法不适用于分区表

2.LIKE

(1).无分区表测试

--只复制与ori_table表结构的语句
create table new_table_like like ori_table;

show create table new_table_like;  --执行看一下效果

select * from new_table_like;   --执行看一下数据量

 

 

(2).分区表测试

--只复制与ori_table_partition表结构的语句
create table new_table_partition_like like ori_table_partition;

show create table new_table_partition_like; --执行看一下效果

 select * from new_table_partition_like;   --执行看一下数据量

结论:

LIKE语法适用于分区表及无分区表 

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

相关文章:

  • 网站对应的ip地址吗广州易网网站建设
  • 昆山规模的网站建设公司有哪些新开传奇网站站
  • 做暧暧国外网站世界工厂网网页版
  • 创欧科技 网站建设淘客网站推广怎么做
  • 品牌网站建设磐石网络优等三水网站建设哪家好
  • 市场调研数据网站百度快照怎么看
  • 私人网站建设成本品牌型网站制作有哪些公司
  • seo网站地图2022世界500强企业排名
  • 外贸企业网站制作公司多个微信管理系统
  • 青海省公路建设管理局网站国内seo公司
  • 保定市建设局安监网站公司宣传册模板免费下载
  • ftp怎么设置网站首页伤豆丁文库网站开发
  • 长春网站分析如何看网站开发语言
  • 模板网站和定制网站的优劣势对比wordpress账户密码为空
  • 水产食品企业网站模板网站交换链接的网络营销意义
  • 网站开发z亿玛酷1流量订制怎么做网站站内优化
  • 濮阳市住房和城乡建设局网站wordpress主题怎么制作
  • 上市公司网站建设分析阳江网站制作公司
  • 个体工商户做的网站能推广吗平台企业是什么意思
  • 城市文明建设网站抖音网络营销推广方式
  • 天津市网站建设天津商城建设品牌注册名词解释
  • 网站设计公司有哪些铁岭做网站的
  • 网站设计三把火58同城网站的建设目标是什么
  • 贵州省公路建设集团有限公司网站三合一企业网站模板
  • 广元建设局网站摄影作品共享网站开发背景
  • 挖掘爱站网福州网站推广优化
  • 网站建设知名私人订制
  • 有哪些企业会找人做网站建设网站开发 浏览器
  • 东莞市凤岗建设局网站seo搜索优化邵阳
  • 朔州seo网站建设网站建设合同范本下载