mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 04:27:39 +00:00
(improvement)(headless) Divide dimensions into four types: identify, category, time and partition time (#1509)
Co-authored-by: lxwcodemonkey
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.tencent.supersonic.headless.api.pojo;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.SemanticType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -9,7 +8,9 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@@ -26,7 +27,6 @@ public class SchemaElement implements Serializable {
|
||||
private String bizName;
|
||||
private Long useCnt;
|
||||
private SchemaElementType type;
|
||||
private SemanticType semanticType;
|
||||
private List<String> alias;
|
||||
private List<SchemaValueMap> schemaValueMaps;
|
||||
private List<RelatedSchemaElement> relatedSchemaElements;
|
||||
@@ -36,6 +36,8 @@ public class SchemaElement implements Serializable {
|
||||
private int isTag;
|
||||
private String description;
|
||||
private boolean descriptionMapped;
|
||||
@Builder.Default
|
||||
private Map<String, Object> extInfo = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -4,6 +4,16 @@ package com.tencent.supersonic.headless.api.pojo.enums;
|
||||
public enum DimensionType {
|
||||
|
||||
categorical,
|
||||
time
|
||||
time,
|
||||
partition_time,
|
||||
identify;
|
||||
|
||||
public static Boolean isTimeDimension(String type) {
|
||||
return time.name().equals(type) || partition_time.name().equals(type);
|
||||
}
|
||||
|
||||
public static Boolean isTimeDimension(DimensionType type) {
|
||||
return time.equals(type) || partition_time.equals(type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.tencent.supersonic.headless.api.pojo.response;
|
||||
import com.tencent.supersonic.common.pojo.enums.DataTypeEnums;
|
||||
import com.tencent.supersonic.headless.api.pojo.DimValueMap;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.DimensionType;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@@ -18,7 +19,7 @@ public class DimensionResp extends SchemaItem {
|
||||
|
||||
private Long modelId;
|
||||
|
||||
private String type;
|
||||
private DimensionType type;
|
||||
|
||||
private String expr;
|
||||
|
||||
@@ -42,4 +43,8 @@ public class DimensionResp extends SchemaItem {
|
||||
|
||||
private Map<String, Object> ext = new HashMap<>();
|
||||
|
||||
public boolean isTimeDimension() {
|
||||
return DimensionType.isTimeDimension(type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user