Skip to content

Commit

Permalink
[improvement][launcher]Refactor built-in demos.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryjzhang committed Nov 10, 2024
1 parent 14a19a9 commit 5368e0b
Show file tree
Hide file tree
Showing 19 changed files with 2,464 additions and 2,810 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public void process(ExecuteContext executeContext, QueryResult queryResult) {
}

private void fillSimilarMetric(SemanticParseInfo parseInfo) {
if (!parseInfo.getQueryType().equals(QueryType.AGGREGATE)
if (Objects.isNull(parseInfo.getQueryType())
|| !parseInfo.getQueryType().equals(QueryType.AGGREGATE)
|| parseInfo.getMetrics().size() > METRIC_RECOMMEND_SIZE
|| CollectionUtils.isEmpty(parseInfo.getMetrics())) {
return;
Expand Down
4 changes: 3 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ services:
sleep 15 &&
if ! mysql -h supersonic_mysql -usupersonic_user -psupersonic_password -e 'use supersonic_db; show tables;' | grep -q 's2_database'; then
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/schema-mysql.sql &&
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/data-mysql.sql
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/schema-mysql-demo.sql &&
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/data-mysql.sql &&
mysql -h supersonic_mysql -usupersonic_user -psupersonic_password supersonic_db < /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/db/data-mysql-demo.sql
else
echo 'Database already initialized.'
fi
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.tencent.supersonic.chat.server.service.PluginService;
import com.tencent.supersonic.common.config.ChatModel;
import com.tencent.supersonic.common.pojo.User;
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
import com.tencent.supersonic.common.pojo.enums.TypeEnums;
import com.tencent.supersonic.common.service.ChatModelService;
import com.tencent.supersonic.common.util.AESEncryptionUtil;
import com.tencent.supersonic.headless.api.pojo.DataSetModelConfig;
Expand All @@ -17,6 +19,8 @@
import com.tencent.supersonic.headless.api.pojo.enums.DataType;
import com.tencent.supersonic.headless.api.pojo.enums.TagDefineType;
import com.tencent.supersonic.headless.api.pojo.request.DatabaseReq;
import com.tencent.supersonic.headless.api.pojo.request.DictItemReq;
import com.tencent.supersonic.headless.api.pojo.request.DictSingleTaskReq;
import com.tencent.supersonic.headless.api.pojo.request.TagReq;
import com.tencent.supersonic.headless.api.pojo.response.DatabaseResp;
import com.tencent.supersonic.headless.api.pojo.response.DimensionResp;
Expand Down Expand Up @@ -198,4 +202,11 @@ protected RelateDimension getRelateDimension(List<Long> dimensionIds) {
protected void updateQueryScore(Integer queryId) {
chatManageService.updateFeedback(queryId, 5, "");
}

protected void enableDimensionValue(DimensionResp dimension) {
dictConfService.addDictConf(DictItemReq.builder().type(TypeEnums.DIMENSION)
.itemId(dimension.getId()).status(StatusEnum.ONLINE).build(), defaultUser);
dictTaskService.addDictTask(DictSingleTaskReq.builder().itemId(dimension.getId())
.type(TypeEnums.DIMENSION).build(), defaultUser);
}
}
Loading

0 comments on commit 5368e0b

Please sign in to comment.