lishaoguang created FLINK-33788:
-----------------------------------
Summary: 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
{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)