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

网站建设有几种方式宁波seo优势

网站建设有几种方式,宁波seo优势,wordpress中文版下载地址,营销网站建设的公司【hive】hive修复分区或修复表 以及msck命令的使用 文章目录 【hive】hive修复分区或修复表 以及msck命令的使用问题原因#xff1a;解决方法#xff1a;msck命令解析#xff1a;例子: 问题原因#xff1a; 之前hive里有数据#xff0c;后面存储元数据信息的MySQL数据库坏…【hive】hive修复分区或修复表 以及msck命令的使用 文章目录 【hive】hive修复分区或修复表 以及msck命令的使用问题原因解决方法msck命令解析例子: 问题原因 之前hive里有数据后面存储元数据信息的MySQL数据库坏了导致hive元数据信息丢失但是hdfs上hive表的数据并没有丢失重新建表后查看hive分区没有数据也没有。 解决方法 MSCK REPAIR TABLE 是在 Hive 中用于修复分区表Partitioned Table元数据的命令。在 Hive 中当您向分区表添加、删除或更改分区数据时有时会导致分区元数据不一致的情况。使用MSCK REPAIR TABLE命令可以检测并修复这些不一致从而确保分区表的元数据与实际数据保持一致。 msck repair table table_name;msck命令解析 MSCK REPAIR TABLE 命令会扫描表的数据存储位置检测缺失的分区并更新元数据。这在以下情况下特别有用 当手动添加或删除分区时元数据可能不会自动更新。当通过外部操作更改了表的分区数据时元数据可能不会自动同步。 我们知道hive有个服务叫metastore这个服务主要是存储一些元数据信息比如数据库名表名或者表的分区等等信息。如果不是通过hive的insert等插入语句很多分区信息在metastore中是没有的如果插入分区数据量很多的话你用 ALTER TABLE table_name ADD PARTITION 一个个分区添加十分麻烦。这时候MSCK REPAIR TABLE就派上用场了。只需要运行MSCK REPAIR TABLE命令hive就会去检测这个表在hdfs上的文件把没有写入metastore的分区信息写入metastore。 例子: 我们先创建一个分区表然后往其中的一个分区插入一条数据在查看分区信息 CREATE TABLE repair_test (col_a STRING) PARTITIONED BY (par STRING); INSERT INTO TABLE repair_test PARTITION(parpartition_1) VALUES (test); SHOW PARTITIONS repair_test;查看分区信息的结果如下 jdbc:hive2://localhost:10000 show partitions repair_test;INFO : Compiling command(queryIdhive_20180810175151_5260f52e-10bb-4589-ad48-31ba72a81c21): show partitions repair_test INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:partition, type:string, comment:from deserializer)], properties:null) INFO : Completed compiling command(queryIdhive_20180810175151_5260f52e-10bb-4589-ad48-31ba72a81c21); Time taken: 0.029 seconds INFO : Executing command(queryIdhive_20180810175151_5260f52e-10bb-4589-ad48-31ba72a81c21): show partitions repair_test INFO : Starting task [Stage-0:DDL] in serial mode INFO : Completed executing command(queryIdhive_20180810175151_5260f52e-10bb-4589-ad48-31ba72a81c21); Time taken: 0.017 seconds INFO : OK -------------------- | partition | -------------------- | parpartition_1 | -------------------- 1 row selected (0.073 seconds) 0: jdbc:hive2://localhost:10000 然后我们通过hdfs的put命令手动创建一个数据 [ericssonh3cnamenode1 pcc]$ echo 123123 test.txt [ericssonh3cnamenode1 pcc]$ hdfs dfs -mkdir -p /user/hive/warehouse/test.db/repair_test/parpartition_2/ [ericssonh3cnamenode1 pcc]$ hdfs dfs -put -f test.txt /user/hive/warehouse/test.db/repair_test/parpartition_2/ [ericssonh3cnamenode1 pcc]$ hdfs dfs -ls -R /user/hive/warehouse/test.db/repair_test drwxrwxrwt - ericsson hive 0 2018-08-10 17:46 /user/hive/warehouse/test.db/repair_test/parpartition_1 drwxrwxrwt - ericsson hive 0 2018-08-10 17:46 /user/hive/warehouse/test.db/repair_test/parpartition_1/.hive-staging_hive_2018-08-10_17-45-59_029_1594310228554990949-1 drwxrwxrwt - ericsson hive 0 2018-08-10 17:46 /user/hive/warehouse/test.db/repair_test/parpartition_1/.hive-staging_hive_2018-08-10_17-45-59_029_1594310228554990949-1/-ext-10000 -rwxrwxrwt 3 ericsson hive 5 2018-08-10 17:46 /user/hive/warehouse/test.db/repair_test/parpartition_1/000000_0 drwxr-xr-x - ericsson hive 0 2018-08-10 17:57 /user/hive/warehouse/test.db/repair_test/parpartition_2 -rw-r--r-- 3 ericsson hive 7 2018-08-10 17:57 /user/hive/warehouse/test.db/repair_test/parpartition_2/test.txt [ericssonh3cnamenode1 pcc]$ 这时候我们查询分区信息发现partition_2这个分区并没有加入到hive中 0: jdbc:hive2://localhost:10000 show partitions repair_test; INFO : Compiling command(queryIdhive_20180810175959_e7cefe8c-57b5-486c-8e03-b1201dac4d79): show partitions repair_test INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:partition, type:string, comment:from deserializer)], properties:null) INFO : Completed compiling command(queryIdhive_20180810175959_e7cefe8c-57b5-486c-8e03-b1201dac4d79); Time taken: 0.029 seconds INFO : Executing command(queryIdhive_20180810175959_e7cefe8c-57b5-486c-8e03-b1201dac4d79): show partitions repair_test INFO : Starting task [Stage-0:DDL] in serial mode INFO : Completed executing command(queryIdhive_20180810175959_e7cefe8c-57b5-486c-8e03-b1201dac4d79); Time taken: 0.02 seconds INFO : OK -------------------- | partition | -------------------- | parpartition_1 | -------------------- 1 row selected (0.079 seconds) 0: jdbc:hive2://localhost:10000运行MSCK REPAIR TABLE 命令后再查询分区信息,可以看到通过put命令放入的分区已经可以查询了 0: jdbc:hive2://localhost:10000 MSCK REPAIR TABLE repair_test; INFO : Compiling command(queryIdhive_20180810180000_7099daf2-6fde-44dd-8938-d2a02589358f): MSCK REPAIR TABLE repair_test INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:null, properties:null) INFO : Completed compiling command(queryIdhive_20180810180000_7099daf2-6fde-44dd-8938-d2a02589358f); Time taken: 0.004 seconds INFO : Executing command(queryIdhive_20180810180000_7099daf2-6fde-44dd-8938-d2a02589358f): MSCK REPAIR TABLE repair_test INFO : Starting task [Stage-0:DDL] in serial mode INFO : Completed executing command(queryIdhive_20180810180000_7099daf2-6fde-44dd-8938-d2a02589358f); Time taken: 0.138 seconds INFO : OK No rows affected (0.154 seconds) 0: jdbc:hive2://localhost:10000 show partitions repair_test; INFO : Compiling command(queryIdhive_20180810180000_ff711820-6f41-4d5d-9fee-b6e1cdbe1e25): show partitions repair_test INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:partition, type:string, comment:from deserializer)], properties:null) INFO : Completed compiling command(queryIdhive_20180810180000_ff711820-6f41-4d5d-9fee-b6e1cdbe1e25); Time taken: 0.045 seconds INFO : Executing command(queryIdhive_20180810180000_ff711820-6f41-4d5d-9fee-b6e1cdbe1e25): show partitions repair_test INFO : Starting task [Stage-0:DDL] in serial mode INFO : Completed executing command(queryIdhive_20180810180000_ff711820-6f41-4d5d-9fee-b6e1cdbe1e25); Time taken: 0.016 seconds INFO : OK -------------------- | partition | -------------------- | parpartition_1 | | parpartition_2 | -------------------- 2 rows selected (0.088 seconds) 0: jdbc:hive2://localhost:10000 select * from repair_test; INFO : Compiling command(queryIdhive_20180810180101_1225075e-43c8-4a49-b8ef-a12f72544a38): select * from repair_test INFO : Semantic Analysis Completed INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:repair_test.col_a, type:string, comment:null), FieldSchema(name:repair_test.par, type:string, comment:null)], properties:null) INFO : Completed compiling command(queryIdhive_20180810180101_1225075e-43c8-4a49-b8ef-a12f72544a38); Time taken: 0.059 seconds INFO : Executing command(queryIdhive_20180810180101_1225075e-43c8-4a49-b8ef-a12f72544a38): select * from repair_test INFO : Completed executing command(queryIdhive_20180810180101_1225075e-43c8-4a49-b8ef-a12f72544a38); Time taken: 0.001 seconds INFO : OK ---------------------------------------- | repair_test.col_a | repair_test.par | ---------------------------------------- | test | partition_1 | | 123123 | partition_2 | ---------------------------------------- 2 rows selected (0.121 seconds) 0: jdbc:hive2://localhost:10000
http://www.pierceye.com/news/400025/

相关文章:

  • 多城市网站建设免费制作小程序的平台
  • 郑州网站建设出名吗?wordpress获取登录密码
  • 网站建设论文的开题报告重庆市工程建设信息
  • 商务网站设计方案门户网站的优点
  • 河津网站制作wampserver做的网站
  • 洛阳专业网站设计开发制作建站公司零陵区住房和城乡建设局网站
  • 在哪里可以学做网站游戏开发大亨下载
  • 找人做ps的网站无锡 做公司网站
  • 云速建站可以建个人网站吗wordpress仿站难吗
  • 如何取外贸网站域名凡科h5制作教程
  • 蜘蛛不抓取网站的原因中山h5网站建设
  • 百度免费推广网站建网站用的免费软件
  • 网站建设西安哪里好广州做企业网站的公司
  • 汉中市网站建设爱墙 网站怎么做
  • 失物招领网站开发项目需求分析搭建外文网站
  • 免费网站空间免备案自学php做网站
  • 南宁网站建设nnit30郴州市第一职业中专
  • 想开个影视网站 那有做的莱芜信息平台
  • js做网站登录有服务器了怎么做网站
  • 郑州餐饮网站建设哪家好零基础网站建设教学在哪里
  • 讲述做网站的电影建设工程公司名字大全
  • 易语言可以做网站管理系统吗网站备案查询工信部手机版
  • 珠海建站论坛淘宝客网站做一种还是做好几种
  • 杭州公司的网站建设公司教育网站制作运营
  • 福州手游网站建设长春火车站停运了吗
  • wordpress仿站博客视频教程建筑模板哪种好
  • 手机配件网站模板雇主品牌建设
  • 列车营销网站怎么做网站 审批号
  • 嘉定公司网站设计游仙建设局官方网站
  • 青山做网站西安十大网站制作公司