开发者社区> 问答> 正文

为什么flink 1.13.1 sql hive is_generic = false 建表成功后,

我使用flink 1.13.1版本,通过sql创建hive表,程序正常运行,表创建成功,但是没有列信息;我的程序如下: 我连接的是hive 2.3.6版本,使用flink-sql-connector-hive-2.3.6依赖包。

package com.meritdata.cloud.flink.test;

import org.apache.flink.table.api.EnvironmentSettings; import org.apache.flink.table.api.TableEnvironment;

public class Test {

    public static void main(String[] args) {

        EnvironmentSettings bbSettings = EnvironmentSettings.newInstance().useBlinkPlanner().inBatchMode().build();

        TableEnvironment tableEnvironment = TableEnvironment.create(bbSettings);

        tableEnvironment.executeSql("create catalog myhive with (" +                 " 'type' = 'hive', " +                 " 'default-database' = 'default', " +                 ")");

        tableEnvironment.executeSql("use catalog myhive");         tableEnvironment.executeSql("create table if not exists q1 " +                 "( id string ) " +                 "with ('is_generic' = 'false')");

        /**          * hive上表创建成功,没有列, 信息如下          * desc formatted q1;          *          * col_name              data_type             comment          *          *          * Table Parameters:          * flink.is_generic    false          * flink.schema.0.data-type  VARCHAR(2147483647)          * flink.schema.0.name   id          * transient_lastDdTime 1627279802          *          */

    }

}*来自志愿者整理的flink邮件归档

展开
收起
EXCEED 2021-12-02 14:53:13 773 0
1 条回答
写回答
取消 提交回答
  • 1.13不再使用is_generic来标记是不是hive表了 (改成了'connector'='hive') ,文档需要更新一下。不过还是建议DDL操作hive元数据时用hive dialect。*来自志愿者整理的FLINK邮件归档

    2021-12-02 15:04:00
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 龚中强 立即下载
Flink CDC Meetup PPT - 王赫 立即下载
Flink CDC Meetup PPT - 覃立辉 立即下载