全部产品
云市场

MSCK REPAIR TABLE

更新时间:2019-03-17 17:16:39

同步OSS数据源上实际的数据分区信息到元数据中

语法

  1. MSCK REPAIR TABLE table_name

示例

在命令执行前,SHOW PARTITIONS primitives_parquet_p无法显示分区信息。

  1. mysql> show partitions primitives_parquet_p;
  2. +--------+
  3. | Result |
  4. +--------+
  5. | |
  6. +--------+
  7. 1 row in set (0.85 sec)

执行完MSCK REPAIR TABLE命令后,可以看到对应的分区信息:

  1. mysql> msck repair table primitives_parquet_p;
  2. +--------+
  3. | Result |
  4. +--------+
  5. | NULL |
  6. +--------+
  7. 1 row in set (0.94 sec)
  8. mysql> show partitions primitives_parquet_p;
  9. +--------------------------------------------------------------------------+
  10. | Result |
  11. +--------------------------------------------------------------------------+
  12. | year=2009/month=1
  13. year=2009/month=2
  14. year=2009/month=3
  15. year=2009/month=4
  16. |
  17. +--------------------------------------------------------------------------+
  18. 1 row in set (0.33 sec)