mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
9
.github/workflows/centos-ci.yml
vendored
9
.github/workflows/centos-ci.yml
vendored
@@ -1,5 +1,4 @@
|
|||||||
name: supersonic CentOS CI
|
name: supersonic CentOS CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -16,7 +15,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java-version: [8, 11] # 定义要测试的JDK版本
|
java-version: [8, 11, 21] # 定义要测试的JDK版本
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -36,10 +35,14 @@ jobs:
|
|||||||
for i in {1..5}; do
|
for i in {1..5}; do
|
||||||
dnf install -y java-1.8.0-openjdk-devel maven && break || sleep 15
|
dnf install -y java-1.8.0-openjdk-devel maven && break || sleep 15
|
||||||
done
|
done
|
||||||
else
|
elif [ ${{ matrix.java-version }} -eq 11 ]; then
|
||||||
for i in {1..5}; do
|
for i in {1..5}; do
|
||||||
dnf install -y java-11-openjdk-devel maven && break || sleep 15
|
dnf install -y java-11-openjdk-devel maven && break || sleep 15
|
||||||
done
|
done
|
||||||
|
elif [ ${{ matrix.java-version }} -eq 21 ]; then
|
||||||
|
for i in {1..5}; do
|
||||||
|
dnf install -y java-21-openjdk-devel maven && break || sleep 15
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Verify Java and Maven installation
|
- name: Verify Java and Maven installation
|
||||||
|
|||||||
2
.github/workflows/mac-ci.yml
vendored
2
.github/workflows/mac-ci.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java-version: [8, 11] # Define the JDK versions to test
|
java-version: [8, 11, 21] # Define the JDK versions to test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|||||||
2
.github/workflows/ubuntu-ci.yml
vendored
2
.github/workflows/ubuntu-ci.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java-version: [8, 11] # 定义要测试的JDK版本
|
java-version: [8, 11, 21] # 定义要测试的JDK版本
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|||||||
4
.github/workflows/windows-ci.yml
vendored
4
.github/workflows/windows-ci.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java-version: [8, 11]
|
java-version: [8, 11, 21] # Add JDK 21 to the matrix
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.java-version }}
|
java-version: ${{ matrix.java-version }}
|
||||||
distribution: 'adopt'
|
distribution: 'adopt' # You might need to change this if 'adopt' doesn't support JDK 21
|
||||||
|
|
||||||
- name: Cache Maven packages
|
- name: Cache Maven packages
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
|
|||||||
@@ -12,10 +12,13 @@ public class ModelCluster {
|
|||||||
private static final String split = "_";
|
private static final String split = "_";
|
||||||
private Set<Long> modelIds = new LinkedHashSet<>();
|
private Set<Long> modelIds = new LinkedHashSet<>();
|
||||||
private String key;
|
private String key;
|
||||||
public static ModelCluster build(Set<Long> modelIds) {
|
private boolean containsPartitionDimensions;
|
||||||
|
|
||||||
|
public static ModelCluster build(Set<Long> modelIds, Boolean containsPartitionDimensions) {
|
||||||
ModelCluster modelCluster = new ModelCluster();
|
ModelCluster modelCluster = new ModelCluster();
|
||||||
modelCluster.setModelIds(modelIds);
|
modelCluster.setModelIds(modelIds);
|
||||||
modelCluster.setKey(StringUtils.join(modelIds, split));
|
modelCluster.setKey(StringUtils.join(modelIds, split));
|
||||||
|
modelCluster.setContainsPartitionDimensions(containsPartitionDimensions);
|
||||||
return modelCluster;
|
return modelCluster;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ import com.tencent.supersonic.common.pojo.Aggregator;
|
|||||||
import com.tencent.supersonic.common.pojo.Constants;
|
import com.tencent.supersonic.common.pojo.Constants;
|
||||||
import com.tencent.supersonic.common.pojo.DataEvent;
|
import com.tencent.supersonic.common.pojo.DataEvent;
|
||||||
import com.tencent.supersonic.common.pojo.DataItem;
|
import com.tencent.supersonic.common.pojo.DataItem;
|
||||||
|
import com.tencent.supersonic.common.pojo.DateConf;
|
||||||
import com.tencent.supersonic.common.pojo.Filter;
|
import com.tencent.supersonic.common.pojo.Filter;
|
||||||
import com.tencent.supersonic.common.pojo.enums.AuthType;
|
import com.tencent.supersonic.common.pojo.enums.AuthType;
|
||||||
import com.tencent.supersonic.common.pojo.enums.EventType;
|
import com.tencent.supersonic.common.pojo.enums.EventType;
|
||||||
@@ -750,6 +751,9 @@ public class MetricServiceImpl extends ServiceImpl<MetricDOMapper, MetricDO>
|
|||||||
if (modelCluster == null) {
|
if (modelCluster == null) {
|
||||||
throw new IllegalArgumentException("Invalid input parameters, unable to obtain valid metrics");
|
throw new IllegalArgumentException("Invalid input parameters, unable to obtain valid metrics");
|
||||||
}
|
}
|
||||||
|
if (!modelCluster.isContainsPartitionDimensions()) {
|
||||||
|
queryMetricReq.setDateInfo(null);
|
||||||
|
}
|
||||||
//4. set groups
|
//4. set groups
|
||||||
List<String> dimensionBizNames = dimensionResps.stream()
|
List<String> dimensionBizNames = dimensionResps.stream()
|
||||||
.filter(entry -> modelCluster.getModelIds().contains(entry.getModelId()))
|
.filter(entry -> modelCluster.getModelIds().contains(entry.getModelId()))
|
||||||
@@ -759,8 +763,9 @@ public class MetricServiceImpl extends ServiceImpl<MetricDOMapper, MetricDO>
|
|||||||
.map(SchemaItem::getBizName).collect(Collectors.toList());
|
.map(SchemaItem::getBizName).collect(Collectors.toList());
|
||||||
|
|
||||||
QueryStructReq queryStructReq = new QueryStructReq();
|
QueryStructReq queryStructReq = new QueryStructReq();
|
||||||
if (queryMetricReq.getDateInfo().isGroupByDate()) {
|
DateConf dateInfo = queryMetricReq.getDateInfo();
|
||||||
queryStructReq.getGroups().add(queryMetricReq.getDateInfo().getGroupByTimeDimension());
|
if (Objects.nonNull(dateInfo) && dateInfo.isGroupByDate()) {
|
||||||
|
queryStructReq.getGroups().add(dateInfo.getGroupByTimeDimension());
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty(dimensionBizNames)) {
|
if (!CollectionUtils.isEmpty(dimensionBizNames)) {
|
||||||
queryStructReq.getGroups().addAll(dimensionBizNames);
|
queryStructReq.getGroups().addAll(dimensionBizNames);
|
||||||
@@ -795,7 +800,7 @@ public class MetricServiceImpl extends ServiceImpl<MetricDOMapper, MetricDO>
|
|||||||
}
|
}
|
||||||
queryStructReq.setDimensionFilters(filters);
|
queryStructReq.setDimensionFilters(filters);
|
||||||
//7. set dateInfo
|
//7. set dateInfo
|
||||||
queryStructReq.setDateInfo(queryMetricReq.getDateInfo());
|
queryStructReq.setDateInfo(dateInfo);
|
||||||
return queryStructReq;
|
return queryStructReq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import com.tencent.supersonic.common.util.ContextUtils;
|
|||||||
import com.tencent.supersonic.headless.api.pojo.response.ModelSchemaResp;
|
import com.tencent.supersonic.headless.api.pojo.response.ModelSchemaResp;
|
||||||
import com.tencent.supersonic.headless.server.pojo.ModelCluster;
|
import com.tencent.supersonic.headless.server.pojo.ModelCluster;
|
||||||
import com.tencent.supersonic.headless.server.service.SchemaService;
|
import com.tencent.supersonic.headless.server.service.SchemaService;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -29,12 +32,23 @@ public class ModelClusterBuilder {
|
|||||||
modelClusters.add(modelCluster);
|
modelClusters.add(modelCluster);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return modelClusters.stream().map(ModelCluster::build)
|
|
||||||
|
return modelClusters.stream()
|
||||||
|
.map(modelCluster -> getModelCluster(modelIdToModelSchema, modelCluster))
|
||||||
.collect(Collectors.toMap(ModelCluster::getKey, value -> value, (k1, k2) -> k1));
|
.collect(Collectors.toMap(ModelCluster::getKey, value -> value, (k1, k2) -> k1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ModelCluster getModelCluster(Map<Long, ModelSchemaResp> modelIdToModelSchema, Set<Long> modelIds) {
|
||||||
|
boolean containsPartitionDimensions = modelIds.stream()
|
||||||
|
.map(modelIdToModelSchema::get)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.anyMatch(modelSchemaResp -> CollectionUtils.isNotEmpty(modelSchemaResp.getTimeDimension()));
|
||||||
|
|
||||||
|
return ModelCluster.build(modelIds, containsPartitionDimensions);
|
||||||
|
}
|
||||||
|
|
||||||
private static void dfs(ModelSchemaResp model, Map<Long, ModelSchemaResp> modelMap,
|
private static void dfs(ModelSchemaResp model, Map<Long, ModelSchemaResp> modelMap,
|
||||||
Set<Long> visited, Set<Long> modelCluster) {
|
Set<Long> visited, Set<Long> modelCluster) {
|
||||||
visited.add(model.getId());
|
visited.add(model.getId());
|
||||||
modelCluster.add(model.getId());
|
modelCluster.add(model.getId());
|
||||||
for (Long neighborId : model.getModelClusterSet()) {
|
for (Long neighborId : model.getModelClusterSet()) {
|
||||||
|
|||||||
12
pom.xml
12
pom.xml
@@ -36,7 +36,7 @@
|
|||||||
<pagehelper.version>6.1.0</pagehelper.version>
|
<pagehelper.version>6.1.0</pagehelper.version>
|
||||||
<pagehelper.spring.version>2.1.0</pagehelper.spring.version>
|
<pagehelper.spring.version>2.1.0</pagehelper.spring.version>
|
||||||
<mybatis.version>3.5.3</mybatis.version>
|
<mybatis.version>3.5.3</mybatis.version>
|
||||||
<lombok.version>1.18.20</lombok.version>
|
<lombok.version>1.18.30</lombok.version>
|
||||||
<guava.version>32.0.0-jre</guava.version>
|
<guava.version>32.0.0-jre</guava.version>
|
||||||
<hanlp.version>portable-1.8.3</hanlp.version>
|
<hanlp.version>portable-1.8.3</hanlp.version>
|
||||||
<hadoop.version>2.7.2</hadoop.version>
|
<hadoop.version>2.7.2</hadoop.version>
|
||||||
@@ -305,6 +305,16 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
<configuration>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<net.bytebuddy.experimental>true</net.bytebuddy.experimental>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
|||||||
@@ -252,34 +252,36 @@ const ParseTip: React.FC<Props> = ({
|
|||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div className={`${prefixCls}-tip-item-filter-content`}>
|
<div className={`${prefixCls}-tip-item-filter-content`}>
|
||||||
<div className={tipItemOptionClass}>
|
{!!dateInfo && (
|
||||||
<span className={`${prefixCls}-tip-item-filter-name`}>数据时间:</span>
|
<div className={tipItemOptionClass}>
|
||||||
{nativeQuery ? (
|
<span className={`${prefixCls}-tip-item-filter-name`}>数据时间:</span>
|
||||||
<span className={itemValueClass}>
|
{nativeQuery ? (
|
||||||
{startDate === endDate ? startDate : `${startDate} ~ ${endDate}`}
|
<span className={itemValueClass}>
|
||||||
</span>
|
{startDate === endDate ? startDate : `${startDate} ~ ${endDate}`}
|
||||||
) : (
|
</span>
|
||||||
<RangePicker
|
) : (
|
||||||
value={[dayjs(startDate), dayjs(endDate)]}
|
<RangePicker
|
||||||
onChange={onDateInfoChange}
|
value={[dayjs(startDate), dayjs(endDate)]}
|
||||||
format="YYYY-MM-DD"
|
onChange={onDateInfoChange}
|
||||||
renderExtraFooter={() => (
|
format="YYYY-MM-DD"
|
||||||
<Row gutter={[28, 28]}>
|
renderExtraFooter={() => (
|
||||||
{Object.keys(ranges).map(key => (
|
<Row gutter={[28, 28]}>
|
||||||
<Col key={key}>
|
{Object.keys(ranges).map(key => (
|
||||||
<Button
|
<Col key={key}>
|
||||||
size="small"
|
<Button
|
||||||
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
|
size="small"
|
||||||
>
|
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
|
||||||
{key}
|
>
|
||||||
</Button>
|
{key}
|
||||||
</Col>
|
</Button>
|
||||||
))}
|
</Col>
|
||||||
</Row>
|
))}
|
||||||
)}
|
</Row>
|
||||||
/>
|
)}
|
||||||
)}
|
/>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{filters?.map((filter: any, index: number) => (
|
{filters?.map((filter: any, index: number) => (
|
||||||
<FilterItem
|
<FilterItem
|
||||||
modelId={modelId!}
|
modelId={modelId!}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { exportTextFile } from '../../utils/utils';
|
|||||||
type Props = {
|
type Props = {
|
||||||
agentId?: number;
|
agentId?: number;
|
||||||
queryId: number;
|
queryId: number;
|
||||||
|
question: string;
|
||||||
llmReq?: any;
|
llmReq?: any;
|
||||||
llmResp?: any;
|
llmResp?: any;
|
||||||
integrateSystem?: string;
|
integrateSystem?: string;
|
||||||
@@ -23,6 +24,7 @@ type Props = {
|
|||||||
const SqlItem: React.FC<Props> = ({
|
const SqlItem: React.FC<Props> = ({
|
||||||
agentId,
|
agentId,
|
||||||
queryId,
|
queryId,
|
||||||
|
question,
|
||||||
llmReq,
|
llmReq,
|
||||||
llmResp,
|
llmResp,
|
||||||
integrateSystem,
|
integrateSystem,
|
||||||
@@ -126,6 +128,11 @@ ${format(sqlInfo.querySQL)}
|
|||||||
|
|
||||||
const onExportLog = () => {
|
const onExportLog = () => {
|
||||||
let text = '';
|
let text = '';
|
||||||
|
if (question) {
|
||||||
|
text += `
|
||||||
|
问题:${question}
|
||||||
|
`;
|
||||||
|
}
|
||||||
if (llmReq) {
|
if (llmReq) {
|
||||||
text += getSchemaMapText();
|
text += getSchemaMapText();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,6 +353,7 @@ const ChatItem: React.FC<Props> = ({
|
|||||||
<SqlItem
|
<SqlItem
|
||||||
agentId={agentId}
|
agentId={agentId}
|
||||||
queryId={parseInfo.queryId}
|
queryId={parseInfo.queryId}
|
||||||
|
question={msg}
|
||||||
llmReq={llmReq}
|
llmReq={llmReq}
|
||||||
llmResp={llmResp}
|
llmResp={llmResp}
|
||||||
integrateSystem={integrateSystem}
|
integrateSystem={integrateSystem}
|
||||||
|
|||||||
Reference in New Issue
Block a user