3 Commits

Author SHA1 Message Date
jerryjzhang
de60be3908 refactor(model): default measure agg to none.
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled
2026-06-23 22:40:10 +08:00
jerryjzhang
0868850edd fix(headless): 解决数据集维度数据类型映射空指针异常
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled
- 添加对 dataTypeMap 的 containsKey 检查避免空指针异常
- 修复维度数据类型映射逻辑中的潜在运行时错误
- 确保在模型ID不存在时跳过数据类型映射操作
2026-06-20 17:43:12 +08:00
jerryjzhang
6d41ce4c5b fix(mapper): 优先按相似度排序并保留所有完全匹配项
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled
2026-06-09 19:48:02 +08:00
4 changed files with 15 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@@ -50,8 +51,12 @@ public class HanlpDictMatchStrategy extends SingleMatchStrategy<HanlpMapResult>
return new ArrayList<>(); return new ArrayList<>();
} }
// step3. merge pre/suffix result // step3. merge pre/suffix result
// sort by similarity (desc) first, then name length (desc), so that
// higher-similarity records are inserted first and survive LinkedHashSet dedup
hanlpMapResults = hanlpMapResults.stream() hanlpMapResults = hanlpMapResults.stream()
.sorted((a, b) -> -(b.getName().length() - a.getName().length())) .sorted(Comparator.comparingDouble(HanlpMapResult::getSimilarity).reversed()
.thenComparing((a, b) -> Integer.compare(b.getName().length(),
a.getName().length())))
.collect(Collectors.toCollection(LinkedHashSet::new)); .collect(Collectors.toCollection(LinkedHashSet::new));
// step4. filter by similarity // step4. filter by similarity

View File

@@ -123,15 +123,9 @@ public class MapFilter {
.filter(SchemaElementMatch::isFullMatched).collect(Collectors.toList()); .filter(SchemaElementMatch::isFullMatched).collect(Collectors.toList());
if (!fullMatches.isEmpty()) { if (!fullMatches.isEmpty()) {
// If there are objects with similarity=1.0, choose the one with the longest // Keep all records with similarity=1.0, as they may correspond to different
// detectWord and smallest offset // elementIds with the same detectWord
SchemaElementMatch bestMatch = fullMatches.stream() result.addAll(fullMatches);
.max(Comparator.comparing(
(SchemaElementMatch match) -> match.getDetectWord().length()))
.orElse(null);
if (bestMatch != null) {
result.add(bestMatch);
}
} else { } else {
// If there are no objects with similarity=1.0, keep all objects with similarity<1.0 // If there are no objects with similarity=1.0, keep all objects with similarity<1.0
result.addAll(group); result.addAll(group);

View File

@@ -123,9 +123,11 @@ public class DataSetSchemaBuilder {
dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_DATA_TYPE, dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_DATA_TYPE,
dim.getDataType()); dim.getDataType());
} else { } else {
if (dataTypeMap.containsKey(dim.getModelId())) {
dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_DATA_TYPE, dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_DATA_TYPE,
dataTypeMap.get(dim.getModelId()).get(dim.getBizName())); dataTypeMap.get(dim.getModelId()).get(dim.getBizName()));
} }
}
if (dim.isTimeDimension()) { if (dim.isTimeDimension()) {
String timeFormat = String timeFormat =
String.valueOf(dim.getExt().get(DimensionConstants.DIMENSION_TIME_FORMAT)); String.valueOf(dim.getExt().get(DimensionConstants.DIMENSION_TIME_FORMAT));

View File

@@ -105,7 +105,7 @@ const ModelFieldForm: React.FC<Props> = ({
let defaultParams:any = {}; let defaultParams:any = {};
if (value === EnumDataSourceType.MEASURES) { if (value === EnumDataSourceType.MEASURES) {
defaultParams = { defaultParams = {
agg: AGG_OPTIONS[0].value, agg: AGG_OPTIONS[AGG_OPTIONS.length - 1].value,
classType: EnumDataSourceType.MEASURES, classType: EnumDataSourceType.MEASURES,
type: EnumDataSourceType.MEASURES, type: EnumDataSourceType.MEASURES,
}; };
@@ -217,7 +217,7 @@ const ModelFieldForm: React.FC<Props> = ({
handleFieldChange(record, 'agg', value); handleFieldChange(record, 'agg', value);
}} }}
allowClear allowClear
defaultValue={AGG_OPTIONS[0].value} defaultValue={AGG_OPTIONS[AGG_OPTIONS.length - 1].value}
style={{ width: '100%' }} style={{ width: '100%' }}
> >
{AGG_OPTIONS.map((item) => ( {AGG_OPTIONS.map((item) => (