You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "luoyuxia (Jira)" <ji...@apache.org> on 2023/12/11 03:44:00 UTC
[jira] [Assigned] (FLINK-33788) Table not found for catalogname is capital
[ https://issues.apache.org/jira/browse/FLINK-33788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
luoyuxia reassigned FLINK-33788:
--------------------------------
Assignee: lishaoguang
> Table not found for catalogname is capital
> ------------------------------------------
>
> Key: FLINK-33788
> URL: https://issues.apache.org/jira/browse/FLINK-33788
> Project: Flink
> Issue Type: Bug
> Affects Versions: 1.16.1
> Reporter: lishaoguang
> Assignee: lishaoguang
> Priority: Major
> Attachments: image-2023-12-09-20-26-41-150.png, screenshot-1.png
>
>
> {code:java}
> String runMode=args[0];
> String sql = "select * from student";
> String sql = "insert into table student select * from student;";
> String sql = args[1];
> String catalogName = "myHive";
> String defaultDatabase = args[2];
> RuntimeExecutionMode executionMode = "batch".equals(runMode) ? RuntimeExecutionMode.BATCH : RuntimeExecutionMode.STREAMING;
> StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
> env.setRuntimeMode(executionMode);
> StreamTableEnvironment tenv = StreamTableEnvironment.create(env);
>
> tenv.getConfig().setSqlDialect(SqlDialect.HIVE);
> Configuration conf = new Configuration();
> conf.addResource("/ect/hadoop/conf");
> conf.addResource("/ect/hive/conf");
> HiveConf hiveConf = new HiveConf(conf, Configuration.class);
> String hiveVersion = "3.1.3";
> HiveCatalog hiveCatalog = new HiveCatalog(catalogName, defaultDatabase, hiveConf, hiveVersion, true);
> tenv.registerCatalog(catalogName, hiveCatalog);
> tenv.useCatalog(catalogName);
> tenv.useDatabase(defaultDatabase);
> tenv.executeSql(sql).print(); {code}
> Even if the table exists in hive, the query will still report an error like"Caused by: org.apache.hadoop.hive.ql.parse.SemanticException: Line 1:14 Table not found 'student'"
--
This message was sent by Atlassian Jira
(v8.20.10#820010)