Merge pull request #6945 from dataease/pr@dev@fix_union

fix: 关联数据集报错 #6894
This commit is contained in:
Junjun 2023-11-30 16:57:44 +08:00 committed by GitHub
commit 68551c59a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1659,9 +1659,18 @@ public class DataSetTableService {
}
List<DatasetTableField> fields = dataSetTableFieldsService.getListByIdsEach(unionDTO.getCurrentDsField());
String[] array = fields.stream().filter(Objects::nonNull)
.map(f -> table + "." + f.getDataeaseName() + " AS "
+ TableUtils.fieldName(tableId + "_" + f.getDataeaseName()))
String[] array = fields.stream()
.map(f -> {
String s = "";
if (f == null) {
DEException.throwException(
Translator.get("i18n_ds_error"));
} else {
s = table + "." + f.getDataeaseName() + " AS "
+ TableUtils.fieldName(tableId + "_" + f.getDataeaseName());
}
return s;
})
.toArray(String[]::new);
checkedInfo.put(table, array);
checkedFields.addAll(fields);