mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
Refactor translator module (#1932)
* [improvement][Chat] Support agent permission management #1143 * [improvement][chat]Iterate LLM prompts of parsing and correction. * [improvement][headless]Clean code logic of headless core. * (fix) (chat) 记忆管理更新不生效 (#1912) * [improvement][headless-fe] Added null-check conditions to the data formatting function. * [improvement][headless]Clean code logic of headless translator. * [improvement][headless-fe] Added permissions management for agents. * [improvement][headless-fe] Unified the assistant's permission settings interaction to match the system style. * [improvement](Dict)Support returns dict task list of dimensions by page * [improvement][headless-fe] Revised the interaction for semantic modeling routing and implemented the initial version of metric management switching. * [improvement][launcher]Set system property `s2.test` in junit tests in order to facilitate conditional breakpoints. * [improvement][headless] add validateAndQuery interface in SqlQueryApiController * [improvement][launcher]Use API to get element ID avoiding hard-code. * [improvement][launcher]Support DuckDB database and refactor translator code structure. --------- Co-authored-by: lxwcodemonkey <jolunoluo@tencent.com> Co-authored-by: tristanliu <tristanliu@tencent.com> Co-authored-by: daikon12 <1059907724@qq.com> Co-authored-by: lexluo09 <39718951+lexluo09@users.noreply.github.com>
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package com.tencent.supersonic.chat.core.parser.aggregate;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.AggOption;
|
||||
import com.tencent.supersonic.headless.core.pojo.QueryStatement;
|
||||
import com.tencent.supersonic.headless.core.translator.calcite.CalciteQueryParser;
|
||||
import com.tencent.supersonic.headless.core.translator.parser.calcite.CalciteQueryParser;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testng.Assert;
|
||||
|
||||
@@ -318,7 +317,7 @@ public class CalciteSqlParserTest {
|
||||
+ " \"updatedAt\": 1711367511146\n" + " }\n" + " }\n" + "}";
|
||||
QueryStatement queryStatement = JSON.parseObject(json, QueryStatement.class);
|
||||
CalciteQueryParser calciteSqlParser = new CalciteQueryParser();
|
||||
calciteSqlParser.parse(queryStatement, AggOption.DEFAULT);
|
||||
calciteSqlParser.parse(queryStatement);
|
||||
Assert.assertEquals(queryStatement.getSql().trim().replaceAll("\\s+", ""),
|
||||
"SELECT`imp_date`AS`sys_imp_date`,SUM(1)AS`pv`" + "FROM" + "`s2_pv_uv_statis`"
|
||||
+ "GROUPBY`imp_date`,`imp_date`");
|
||||
|
||||
Reference in New Issue
Block a user