Merge pull request #7683 from dataease/pr@dev-v2@refactor_dataset

refactor: 修复数据集预览报错提示
This commit is contained in:
Junjun 2024-01-18 10:06:16 +08:00 committed by GitHub
commit 8026883a5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,7 +173,7 @@ public class CalciteProvider {
datasetTableFields.add(tableField);
}
list = getDataResult(resultSet);
} catch (Exception e) {
} catch (Exception | AssertionError e) {
DEException.throwException(Translator.get("i18n_fetch_error") + e.getMessage());
} finally {
try {
@ -255,7 +255,7 @@ public class CalciteProvider {
DatasourceConfiguration configuration = null;
DatasourceType datasourceType = DatasourceType.valueOf(ds.getType());
try {
if(rootSchema.getSubSchema(ds.getSchemaAlias()) != null){
if (rootSchema.getSubSchema(ds.getSchemaAlias()) != null) {
JdbcSchema jdbcSchema = rootSchema.getSubSchema(ds.getSchemaAlias()).unwrap(JdbcSchema.class);
BasicDataSource basicDataSource = (BasicDataSource) jdbcSchema.getDataSource();
basicDataSource.close();