Hi,
Hive 自动添加分区依赖于分区提交策略 metastore,所以得添加policy配置才能生效

> 2020年12月23日 上午9:27,kingdomad <[email protected]> 写道:
> 
> 是的。开启了checkpoint。
> 消费kafka,用tableEnv把stream注册成TemporaryView。
> 然后执行sql写入到hive的表中。
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> 
> kingdomad
> 
> 
> 
> 
> 
> 
> 
> 在 2020-12-23 09:22:48,"范瑞" <[email protected]> 写道:
>> Hello
>> 
>> 
>> 请问是使用 Sql吧?开启cp了吗?
>> 
>> 
>> 
>> ---原始邮件---
>> 发件人: "kingdomad"<[email protected]&gt;
>> 发送时间: 2020年12月23日(周三) 上午9:17
>> 收件人: "user-zh"<[email protected]&gt;;
>> 主题: Re:Re: flink1.11.2写hive分区表,hive识别不到分区
>> 
>> 
>> 分区用的是记录中的字段,没有用到processing time或者event time去生成分区。
>> 发现只要给hive的表加上以下这三个属性就可以马上提交分区到metastore了。
>> 'sink.partition-commit.trigger'='process-time'
>> 'sink.partition-commit.delay'='0s'
>> 'sink.partition-commit.policy.kind'='metastore,success-file'
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> --
>> 
>> kingdomad
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 在 2020-12-21 23:27:49,"赵一旦" <[email protected]&gt; 写道:
>> &gt;即使不是flink写入,其他方式写入也需要这样做的哈。
>> &gt;
>> &gt;r pp <[email protected]&gt; 于2020年12月21日周一 下午9:28写道:
>> &gt;
>> &gt;&gt; 程序中,创建表后,执行命令。
>> &gt;&gt;
>> &gt;&gt; kingdomad <[email protected]&gt; 于2020年12月21日周一 下午4:55写道:
>> &gt;&gt;
>> &gt;&gt; &gt;
>> &gt;&gt; 
>> flink1.11.2写hive3.12的分区表,flink新创建的分区数据hive无法识别,在hdfs上能看到写入了文件,但是hive读取不了分区。
>> &gt;&gt; &gt; 需要执行msck repair table修复分区表后,hive才能读取到数据。
>> &gt;&gt; &gt; 求助大佬,要如何解决。
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt; &gt; --
>> &gt;&gt; &gt;
>> &gt;&gt; &gt; kingdomad
>> &gt;&gt; &gt;
>> &gt;&gt; &gt;
>> &gt;&gt;

回复