mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-06-25 22:29:22 +08:00
fix(headless): 解决数据集维度数据类型映射空指针异常
- 添加对 dataTypeMap 的 containsKey 检查避免空指针异常 - 修复维度数据类型映射逻辑中的潜在运行时错误 - 确保在模型ID不存在时跳过数据类型映射操作
This commit is contained in:
@@ -55,7 +55,8 @@ public class HanlpDictMatchStrategy extends SingleMatchStrategy<HanlpMapResult>
|
||||
// higher-similarity records are inserted first and survive LinkedHashSet dedup
|
||||
hanlpMapResults = hanlpMapResults.stream()
|
||||
.sorted(Comparator.comparingDouble(HanlpMapResult::getSimilarity).reversed()
|
||||
.thenComparing((a, b) -> Integer.compare(b.getName().length(), a.getName().length())))
|
||||
.thenComparing((a, b) -> Integer.compare(b.getName().length(),
|
||||
a.getName().length())))
|
||||
.collect(Collectors.toCollection(LinkedHashSet::new));
|
||||
|
||||
// step4. filter by similarity
|
||||
|
||||
@@ -123,8 +123,10 @@ public class DataSetSchemaBuilder {
|
||||
dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_DATA_TYPE,
|
||||
dim.getDataType());
|
||||
} else {
|
||||
dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_DATA_TYPE,
|
||||
dataTypeMap.get(dim.getModelId()).get(dim.getBizName()));
|
||||
if (dataTypeMap.containsKey(dim.getModelId())) {
|
||||
dimToAdd.getExtInfo().put(DimensionConstants.DIMENSION_DATA_TYPE,
|
||||
dataTypeMap.get(dim.getModelId()).get(dim.getBizName()));
|
||||
}
|
||||
}
|
||||
if (dim.isTimeDimension()) {
|
||||
String timeFormat =
|
||||
|
||||
Reference in New Issue
Block a user