一、该问题的重现步骤是什么?
1. hive的元数据库存在mysql的metastore库中
2. 通过自定义sql查询metastore库中的表时报了这个错误
nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select resource_code, scope_column, scope_field, scope_type, scope_value from blade_scope_data where scope_class = ? and id in (select scope_id from blade_role_scope where scope_category = 1 and role_id in (?))]; nested exception is java.sql.SQLSyntaxErrorException: Table 'metastore.blade_scope_data' doesn't exist ### The error may exist in class path resource [org/springblade/datasourcemonitingdb/mapper/MonitingDbMapper.xml] ### The error may involve org.springblade.datasourcemonitingdb.mapper.MonitingDbMapper.tablelist ### The error occurred while executing a query ### Cause: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select resource_code, scope_column, scope_field, scope_type, scope_value from blade_scope_data where scope_class = ? and id in (select scope_id from blade_role_scope where scope_category = 1 and role_id in (?))]; nested exception is java.sql.SQLSyntaxErrorException: Table 'metastore.blade_scope_data' doesn't exist
3.这是我写的sql
SELECT c.PARAM_VALUE chn_table_name,b.`NAME`,a.TBL_NAME table_name from metastore.TBLS a LEFT join metastore.DBS b on a.DB_ID=b.DB_ID LEFT JOIN metastore.TABLE_PARAMS c on a.TBL_ID = c.TBL_ID where b.NAME in('xuebang_new','hui_ben_guan','xiaoetech','tailwinds_new') and c.PARAM_KEY = 'comment' and b.`NAME` = #{dbName}
二、你期待的结果是什么?实际看到的又是什么?
我期待结果不报错。
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
SpringBoot 2.1.7.RELEASE,centos7
四、请提供详细的错误堆栈信息,这很重要。
五、若有更多详细信息,请在下面提供。
扫一扫访问 Blade技术社区 移动端