mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
[improvement][chat&headless]Remove deprecated system time fields.
This commit is contained in:
@@ -32,6 +32,16 @@ public class Dimension {
|
||||
this.type = type;
|
||||
this.isCreateDimension = isCreateDimension;
|
||||
this.bizName = bizName;
|
||||
this.expr = bizName;
|
||||
}
|
||||
|
||||
public Dimension(String name, String bizName, String expr, DimensionType type,
|
||||
Integer isCreateDimension) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.isCreateDimension = isCreateDimension;
|
||||
this.bizName = bizName;
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public Dimension(String name, String bizName, DimensionType type, Integer isCreateDimension,
|
||||
@@ -45,12 +55,7 @@ public class Dimension {
|
||||
this.bizName = bizName;
|
||||
}
|
||||
|
||||
public static Dimension getDefault() {
|
||||
return new Dimension("数据日期", "imp_date", DimensionType.partition_time, 0, "imp_date",
|
||||
Constants.DAY_FORMAT, new DimensionTimeTypeParams("false", "day"));
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return bizName;
|
||||
return expr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,20 @@ public class Measure {
|
||||
|
||||
private String alias;
|
||||
|
||||
public Measure(String name, String bizName, String expr, String agg, Integer isCreateMetric) {
|
||||
this.name = name;
|
||||
this.agg = agg;
|
||||
this.isCreateMetric = isCreateMetric;
|
||||
this.bizName = bizName;
|
||||
this.expr = expr;
|
||||
}
|
||||
|
||||
public Measure(String name, String bizName, String agg, Integer isCreateMetric) {
|
||||
this.name = name;
|
||||
this.agg = agg;
|
||||
this.isCreateMetric = isCreateMetric;
|
||||
this.bizName = bizName;
|
||||
this.expr = bizName;
|
||||
}
|
||||
|
||||
public Measure(String bizName, String constraint) {
|
||||
@@ -38,4 +47,5 @@ public class Measure {
|
||||
public String getFieldName() {
|
||||
return expr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ import java.util.List;
|
||||
@Data
|
||||
public class MetricDefineByMeasureParams extends MetricDefineParams {
|
||||
|
||||
private List<MeasureParam> measures = Lists.newArrayList();
|
||||
private List<Measure> measures = Lists.newArrayList();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ public class ModelDetail {
|
||||
|
||||
private String queryType;
|
||||
|
||||
private String dbType;
|
||||
|
||||
private String sqlQuery;
|
||||
|
||||
private String tableQuery;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.enums;
|
||||
|
||||
import com.tencent.supersonic.headless.api.pojo.MeasureParam;
|
||||
import com.tencent.supersonic.headless.api.pojo.Measure;
|
||||
import com.tencent.supersonic.headless.api.pojo.MetricDefineByMeasureParams;
|
||||
|
||||
import java.util.List;
|
||||
@@ -32,7 +32,7 @@ public enum MetricType {
|
||||
return true;
|
||||
}
|
||||
if (MetricDefineType.MEASURE.equals(metricDefineType)) {
|
||||
List<MeasureParam> measures = typeParams.getMeasures();
|
||||
List<Measure> measures = typeParams.getMeasures();
|
||||
if (measures.size() > 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class DimSchemaResp extends DimensionResp {
|
||||
|
||||
private Long useCnt = 0L;
|
||||
private Set<String> fields = Sets.newHashSet();
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,13 +2,9 @@ package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.common.pojo.DataFormat;
|
||||
import com.tencent.supersonic.headless.api.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.headless.api.pojo.MetricDefineByFieldParams;
|
||||
import com.tencent.supersonic.headless.api.pojo.MetricDefineByMeasureParams;
|
||||
import com.tencent.supersonic.headless.api.pojo.MetricDefineByMetricParams;
|
||||
import com.tencent.supersonic.headless.api.pojo.RelateDimension;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.*;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.MetricDefineType;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.MetricType;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@@ -69,6 +65,19 @@ public class MetricResp extends SchemaItem {
|
||||
|
||||
private boolean containsPartitionDimensions;
|
||||
|
||||
public void setMetricDefinition(MetricDefineType type, MetricDefineParams params) {
|
||||
if (MetricDefineType.MEASURE.equals(type)) {
|
||||
assert params instanceof MetricDefineByMeasureParams;
|
||||
metricDefineByMeasureParams = (MetricDefineByMeasureParams) params;
|
||||
} else if (MetricDefineType.FIELD.equals(type)) {
|
||||
assert params instanceof MetricDefineByFieldParams;
|
||||
metricDefineByFieldParams = (MetricDefineByFieldParams) params;
|
||||
} else if (MetricDefineType.METRIC.equals(type)) {
|
||||
assert params instanceof MetricDefineByMetricParams;
|
||||
metricDefineByMetricParams = (MetricDefineByMetricParams) params;
|
||||
}
|
||||
}
|
||||
|
||||
public void setClassifications(String tag) {
|
||||
if (StringUtils.isBlank(tag)) {
|
||||
classifications = Lists.newArrayList();
|
||||
@@ -105,4 +114,8 @@ public class MetricResp extends SchemaItem {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public boolean isDerived() {
|
||||
return MetricType.isDerived(metricDefineType, metricDefineByMeasureParams);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class MetricSchemaResp extends MetricResp {
|
||||
|
||||
private Long useCnt = 0L;
|
||||
private Set<String> fields = Sets.newHashSet();
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.headless.api.pojo.Dimension;
|
||||
import com.tencent.supersonic.headless.api.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.headless.api.pojo.Field;
|
||||
import com.tencent.supersonic.headless.api.pojo.Identify;
|
||||
import com.tencent.supersonic.headless.api.pojo.ModelDetail;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.*;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.IdentifyType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.*;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,6 +18,7 @@ import java.util.stream.Collectors;
|
||||
@ToString(callSuper = true)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ModelResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
@@ -62,6 +55,14 @@ public class ModelResp extends SchemaItem {
|
||||
return isOpen != null && isOpen == 1;
|
||||
}
|
||||
|
||||
public List<Measure> getMeasures() {
|
||||
return modelDetail != null ? modelDetail.getMeasures() : Lists.newArrayList();
|
||||
}
|
||||
|
||||
public List<Identify> getIdentifiers() {
|
||||
return modelDetail != null ? modelDetail.getIdentifiers() : Lists.newArrayList();
|
||||
}
|
||||
|
||||
public List<Dimension> getTimeDimension() {
|
||||
if (modelDetail == null) {
|
||||
return Lists.newArrayList();
|
||||
|
||||
Reference in New Issue
Block a user