mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-20 06:34:55 +00:00
(improvement)(chat) Make corrections and pass the data date format to the large model. (#1583)
This commit is contained in:
@@ -2,6 +2,7 @@ package com.tencent.supersonic.headless.api.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@@ -126,4 +127,13 @@ public class DataSetSchema {
|
||||
return dimensions.stream().anyMatch(SchemaElement::containsPartitionTime);
|
||||
}
|
||||
|
||||
public String getPartitionTimeFormat() {
|
||||
for (SchemaElement dimension : dimensions) {
|
||||
String partitionTimeFormat = dimension.getPartitionTimeFormat();
|
||||
if (StringUtils.isNotBlank(partitionTimeFormat)) {
|
||||
return partitionTimeFormat;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,16 +3,18 @@ package com.tencent.supersonic.headless.api.pojo;
|
||||
import com.google.common.base.Objects;
|
||||
import com.tencent.supersonic.common.pojo.DimensionConstants;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.DimensionType;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@@ -65,8 +67,29 @@ public class SchemaElement implements Serializable {
|
||||
if (MapUtils.isEmpty(extInfo)) {
|
||||
return false;
|
||||
}
|
||||
DimensionType dimensionTYpe = (DimensionType) extInfo.get(DimensionConstants.DIMENSION_TYPE);
|
||||
Object o = extInfo.get(DimensionConstants.DIMENSION_TYPE);
|
||||
DimensionType dimensionTYpe = null;
|
||||
if (o instanceof DimensionType) {
|
||||
dimensionTYpe = (DimensionType) o;
|
||||
}
|
||||
if (o instanceof String) {
|
||||
dimensionTYpe = DimensionType.valueOf((String) o);
|
||||
}
|
||||
return DimensionType.isPartitionTime(dimensionTYpe);
|
||||
}
|
||||
|
||||
public String getTimeFormat() {
|
||||
if (MapUtils.isEmpty(extInfo)) {
|
||||
return null;
|
||||
}
|
||||
return (String) extInfo.get(DimensionConstants.DIMENSION_TIME_FORMAT);
|
||||
}
|
||||
|
||||
public String getPartitionTimeFormat() {
|
||||
String timeFormat = getTimeFormat();
|
||||
if (StringUtils.isNotBlank(timeFormat) && containsPartitionTime()) {
|
||||
return timeFormat;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user