岚天逸见

正确DROP掉MOR类型的HUDI表

假设有一张下面这样的 MOR 类型的 hudi 表:

CREATE TABLE t_test_001 (
    ds BIGINT COMMENT 'ds',
    ut BIGINT COMMENT 'ut',
    pk BIGINT COMMENT 'pk',
    a0 BIGINT COMMENT 'a0',
    a1 BIGINT COMMENT 'a1',
    a2 BIGINT COMMENT 'a2'
) USING hudi

则在 drop 该表时,正确的 drop 方法为:

DROP TABLE t_test_001_rt;
DROP TABLE t_test_001_ro;
DROP TABLE t_test_001;

即带尾巴的要放到最后,否则带尾巴的表 drop 不掉:

org.apache.hudi.exception.HoodieIOException: Could not check if hdfs:///user/root/test.db/t_test_001 is a valid table
Caused by: java.io.FileNotFoundException: File does not exist: hdfs:///user/root/test.db/t_test_001/.hoodie

如果只 drop 不带尾巴的表,则使用时会报错:

Caused by: java.sql.SQLException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: org.apache.hudi.exception.HoodieException: Could not sync using the meta sync class org.apache.hudi.hive.HiveSyncTool
... 25 more
Caused by: org.apache.hudi.hive.HoodieHiveSyncException: Could not convert field Type from STRING to bigint for field a2
... 36 more

posted on 2023-05-16 09:22  岚天逸见  阅读(150)  评论(0编辑  收藏  举报

导航