(improvement) Move out the datasource and merge the datasource with the model, and adapt the chat module (#423)

Co-authored-by: jolunoluo <jolunoluo@tencent.com>
This commit is contained in:
jipeli
2023-11-27 11:05:24 +08:00
committed by GitHub
parent 0534053ff9
commit 27bb1b322e
190 changed files with 3900 additions and 10561 deletions

View File

@@ -3,7 +3,8 @@ com.tencent.supersonic.chat.api.component.SchemaMapper=\
com.tencent.supersonic.chat.mapper.HanlpDictMapper, \
com.tencent.supersonic.chat.mapper.FuzzyNameMapper, \
com.tencent.supersonic.chat.mapper.QueryFilterMapper, \
com.tencent.supersonic.chat.mapper.EntityMapper
com.tencent.supersonic.chat.mapper.EntityMapper, \
com.tencent.supersonic.chat.mapper.ModelClusterMapper
com.tencent.supersonic.chat.api.component.SemanticParser=\
com.tencent.supersonic.chat.parser.rule.RuleBasedParser, \
@@ -17,7 +18,8 @@ com.tencent.supersonic.chat.api.component.SemanticCorrector=\
com.tencent.supersonic.chat.corrector.SelectCorrector, \
com.tencent.supersonic.chat.corrector.WhereCorrector, \
com.tencent.supersonic.chat.corrector.GroupByCorrector, \
com.tencent.supersonic.chat.corrector.HavingCorrector
com.tencent.supersonic.chat.corrector.HavingCorrector, \
com.tencent.supersonic.chat.corrector.FromCorrector
com.tencent.supersonic.chat.llm.LLMInterpreter=\
com.tencent.supersonic.chat.llm.HttpLLMInterpreter

View File

@@ -5,14 +5,14 @@ dean _1_2 36
john _1_2 50
jack _1_2 38
admin _1_2 70
周杰伦 _2_7 100
陈奕迅 _2_7 100
林俊杰 _2_7 100
张碧晨 _2_7 100
程响 _2_7 100
Taylor#Swift _2_7 100
内地 _2_4 100
欧美 _2_4 100
港台 _2_4 100
流行 _2_6 100
国风 _2_6 100
周杰伦 _4_9 100
陈奕迅 _4_9 100
林俊杰 _4_9 100
张碧晨 _4_9 100
程响 _4_9 100
Taylor#Swift _4_9 100
内地 _4_6 100
欧美 _4_6 100
港台 _4_6 100
流行 _4_8 100
国风 _4_8 100

View File

@@ -1,6 +1,6 @@
p1 _1_3 52
p2 _1_3 47
p3 _1_3 31
p4 _1_3 36
p5 _1_3 50
p6 _1_3 38
p1 _3_4 52
p2 _3_4 47
p3 _3_4 31
p4 _3_4 36
p5 _3_4 50
p6 _3_4 38

View File

@@ -1,9 +0,0 @@
周杰伦 _2_7 9000
周深 _2_7 8000
周传雄 _2_7 7000
周华建 _2_7 6000
陈奕迅 _2_7 8000
林俊杰 _2_7 7000
张碧晨 _2_7 7000
程响 _2_7 7000
Taylor#Swift _2_7 7000

View File

@@ -0,0 +1,9 @@
周杰伦 _4_9 9000
周深 _4_9 8000
周传雄 _4_9 7000
周华建 _4_9 6000
陈奕迅 _4_9 8000
林俊杰 _4_9 7000
张碧晨 _4_9 7000
程响 _4_9 7000
Taylor#Swift _4_9 7000

View File

@@ -1,68 +0,0 @@
tagore _3_8 9000
nazrul _3_8 9000
民间 _3_8 9000
现代 _3_8 9000
蓝调 _3_8 9000
流行 _3_8 9000
孟加拉国 _3_10 9000
锡尔赫特、吉大港、库斯蒂亚 _3_10 9000
加拿大 _3_10 9000
美国 _3_10 9000
Shrikanta _3_11 9000
Prity _3_11 9000
Farida _3_11 9000
Topu _3_11 9000
Enrique _3_11 9000
Michel _3_11 9000
孟加拉国 _3_12 9000
印度 _3_12 9000
美国 _3_12 9000
英国 _3_12 9000
男性 _3_13 9000
女性 _3_13 9000
mp4 _3_19 9000
mp3 _3_19 9000
Tumi#长袍#尼罗布 _3_20 9000
舒克诺#帕塔尔#努普尔#帕埃 _3_20 9000
阿米·奥帕尔·霍伊 _3_20 9000
我的爱 _3_20 9000
打败它 _3_20 9000
阿杰伊阿卡什 _3_20 9000
孟加拉国 _3_22 9000
印度 _3_22 9000
美国 _3_22 9000
英国 _3_22 9000
孟加拉语 _3_26 9000
英文 _3_26 9000
=======
孟加拉国 _3_8 9000
锡尔赫特、吉大港、库斯蒂亚 _3_8 9000
加拿大 _3_8 9000
美国 _3_8 9000
tagore _3_9 9000
nazrul _3_9 9000
民间 _3_9 9000
现代 _3_9 9000
蓝调 _3_9 9000
流行 _3_9 9000
孟加拉国 _3_10 9000
印度 _3_10 9000
美国 _3_10 9000
英国 _3_10 9000
男性 _3_11 9000
女性 _3_11 9000
Shrikanta _3_12 9000
Prity _3_12 9000
Farida _3_12 9000
Topu _3_12 9000
Enrique _3_12 9000
Michel _3_12 9000
mp4 _3_14 9000
mp3 _3_14 9000
孟加拉语 _3_16 9000
英文 _3_16 9000
Tumi#长袍#尼罗布 _3_18 9000
舒克诺#帕塔尔#努普尔#帕埃 _3_18 9000
阿米·奥帕尔·霍伊 _3_18 9000
我的爱 _3_18 9000
打败它 _3_18 9000

View File

@@ -133,6 +133,10 @@ CREATE TABLE IF NOT EXISTS `s2_model` (
`view_org` varchar(3000) DEFAULT NULL , -- domain available organization
`entity` varchar(500) DEFAULT NULL , -- domain entity info
`drill_down_dimensions` varchar(500) DEFAULT NULL , -- drill down dimensions info
`database_id` INT NOT NULL ,
`model_detail` LONGVARCHAR NOT NULL ,
`depends` varchar(500) DEFAULT NULL ,
`filter_sql` varchar(1000) DEFAULT NULL ,
PRIMARY KEY (`id`)
);
COMMENT ON TABLE s2_model IS 'model information';
@@ -156,16 +160,12 @@ CREATE TABLE `s2_database` (
COMMENT ON TABLE s2_database IS 'database instance table';
CREATE TABLE IF NOT EXISTS `s2_datasource` (
`id` INT NOT NULL AUTO_INCREMENT,
`model_id` INT NOT NULL ,
`name` varchar(255) NOT NULL ,
`id` INT NOT NULL AUTO_INCREMENT,
`model_id` INT NOT NULL ,
`name` varchar(255) NOT NULL ,
`biz_name` varchar(255) NOT NULL ,
`description` varchar(500) DEFAULT NULL ,
`database_id` INT NOT NULL ,
`datasource_detail` LONGVARCHAR NOT NULL ,
`status` int(11) DEFAULT NULL ,
`depends` varchar(500) DEFAULT NULL ,
`filter_sql` varchar(1000) DEFAULT NULL ,
`created_at` TIMESTAMP NOT NULL ,
`created_by` varchar(100) NOT NULL ,
`updated_at` TIMESTAMP NOT NULL ,
@@ -208,7 +208,6 @@ COMMENT ON TABLE s2_metric IS 'metric information table';
CREATE TABLE IF NOT EXISTS `s2_dimension` (
`id` INT NOT NULL AUTO_INCREMENT ,
`model_id` INT NOT NULL ,
`datasource_id` INT NOT NULL ,
`name` varchar(255) NOT NULL ,
`biz_name` varchar(255) NOT NULL ,
`description` varchar(500) NOT NULL ,
@@ -231,20 +230,16 @@ CREATE TABLE IF NOT EXISTS `s2_dimension` (
);
COMMENT ON TABLE s2_dimension IS 'dimension information table';
create table s2_datasource_rela
CREATE TABLE s2_model_rela
(
id INT AUTO_INCREMENT,
model_id INT null,
datasource_from INT null,
datasource_to INT null,
join_key varchar(100) null,
created_at TIMESTAMP null,
created_by varchar(100) null,
updated_at TIMESTAMP null,
updated_by varchar(100) null,
id BIGINT AUTO_INCREMENT,
domain_id BIGINT,
from_model_id BIGINT,
to_model_id BIGINT,
join_type VARCHAR(255),
join_condition VARCHAR(255),
PRIMARY KEY (`id`)
);
COMMENT ON TABLE s2_datasource_rela IS 'data source association table';
create table s2_view_info
(
@@ -535,4 +530,5 @@ CREATE TABLE s2_sys_parameter
id INT PRIMARY KEY AUTO_INCREMENT,
admin varchar(500),
parameters text null
);
);

View File

@@ -453,4 +453,14 @@ CREATE TABLE s2_sys_parameter
id int primary key AUTO_INCREMENT COMMENT '主键id',
admin varchar(500) COMMENT '系统管理员',
parameters text null COMMENT '配置项'
);
CREATE TABLE s2_model_rela
(
id bigint primary key AUTO_INCREMENT,
domain_id bigint,
from_model_id bigint,
to_model_id bigint,
join_type VARCHAR(255),
join_condition VARCHAR(255)
);

View File

@@ -96,4 +96,21 @@ alter table s2_chat_config add column `llm_examples` text COMMENT 'llm examples'
alter table s2_datasource add column `filter_sql` varchar(1000) COMMENT 'filter_sql' after depends;
--20231120
alter table s2_dimension add column `is_tag` int(10) DEFAULT NULL;
alter table s2_dimension add column `is_tag` int(10) DEFAULT NULL;
--20231125
alter table s2_model add column `database_id` INT NOT NULL;
alter table s2_model add column `model_detail` text NOT NULL;
alter table s2_model add column `depends` varchar(500) DEFAULT NULL;
alter table s2_model add column `filter_sql` varchar(1000) DEFAULT NULL;
CREATE TABLE s2_model_rela
(
id BIGINT AUTO_INCREMENT,
domain_id BIGINT,
from_model_id BIGINT,
to_model_id BIGINT,
join_type VARCHAR(255),
join_condition VARCHAR(255),
PRIMARY KEY (`id`)
);