你好, 是否能尝试一下用hive dialect建表呢?
On Mon, Jul 26, 2021 at 2:44 PM Asahi Lee <[email protected]> wrote: > hi! > 我使用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 > * > */ > > > } > > > > > } -- Best regards! Rui Li
