首页 > 其他分享 >【Hive & Spark】修复分区

【Hive & Spark】修复分区

时间:2022-09-01 22:11:52浏览次数:85  
标签:name 分区 DROP SYNC Hive ADD table Spark partitions

语法

MSCK REPAIR TABLE table_identifier [{ADD|DROP|SYNC} PARTITIONS]

msck repair table table_identifier 默认执行的是 add partitions操作


ref: spark.apache.org/docs

Syntax
MSCK REPAIR TABLE table_identifier [{ADD|DROP|SYNC} PARTITIONS]
Parameters
table_identifier

Specifies the name of the table to be repaired. The table name may be optionally qualified with a database name.

Syntax: [ database_name. ] table_name

{ADD|DROP|SYNC} PARTITIONS

Specifies how to recover partitions. If not specified, ADD is the default.

ADD, the command adds new partitions to the session catalog for all sub-folder in the base table folder that don’t belong to any table partitions.
DROP, the command drops all partitions from the session catalog that have non-existing locations in the file system.
SYNC is the combination of DROP and ADD.

标签:name,分区,DROP,SYNC,Hive,ADD,table,Spark,partitions
From: https://www.cnblogs.com/144823836yj/p/16647979.html

相关文章

  • 关闭swap分区
    一、临时关闭swapoff-a二、查看效果free-h三、启用swap分区(不必操作)swapon-a四、永久关闭vim/etc/sysctl.conf#修改vm.swappiness为0vm.swappiness=......
  • java通过jdbc连接hive并实时获取日志(转)
    转载:https://blog.csdn.net/weixin_43455443/article/details/1153439954、通过java代码连接hiveonspark,使用hive-jdbc引入pom文件<dependency><groupId>org.apache.......
  • hive命令数据导入与导出
    数据导入●本地文件导入--本地文件导入(local)LOADDATAlocalINPATH'/home/hadoop/sourceA.txt'INTOTABLEtestAPARTITION(create_time='2015-07-08'); ●H......
  • Spark遇到的一些问题
    1.sparkDataframe的生命周期及执行   上述小测试是想保留value只保留(1,张三)这条数据,这条数据的来源是test1表,现对test1表进行操作(改为2,李四),同时希望value不变......
  • 大数据分析常用组件、框架、架构介绍(Hadoop、Spark、Storm、Flume、Kafka、Logstash、
    首先,数据传输组件:①Kafka是用Scala编写的分布式消息处理平台。②Logstash是用JRuby编写的一种分布式日志收集框架。③Flume是用Java编写的分布式实时日志收集框架。......
  • Spark面试题
     一、Spark基础篇1、Spark是什么?Spark是一个通用分布式内存计算引擎。2009年在加州大学伯克利分校AMP实验室诞生,2014年2月,Spark成为Apache的顶级项目。......
  • Hive中insert into 和 insert overwrite的区别
    相同点insertinto和insertoverwrite都是往表中插入数据的。 不同点区别1:insertinto:其实是将数据追加到表的末尾,注意可不是覆盖是追加。insertoverwrite......
  • sparksql 优化
    最近把spark文档里面配置那一页看了一下,在这记录一些可用的配置,免得后续再去查文档地址:https://spark.apache.org/docs/3.0.1/configuration.htmlSpark文档运行环境......
  • sparkstreaming的创建方式及运行流程及注意事项
    sparkstreaming创建有两种方式1.借助SparkConf对象创建valconf=newSparkConf().setAppName("streamingContext").setMaster("local[4]")/***streamingcontex......
  • Linux下创建swap分区
    1.创建一个swap文件。cd/varsudomkdirswapsudoddif=/dev/zeroof=swapfilebs=1024count=2000000count代表的是大小,我这里是2G。2.把文件转换为swap文件......