mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 04:57:28 +00:00
(improvement)(headless) performParsed skip translation (#1222)
This commit is contained in:
@@ -27,9 +27,7 @@ public class LLMSqlQuery extends LLMSemanticQuery {
|
||||
|
||||
@Override
|
||||
public SemanticQueryReq buildSemanticQueryReq() {
|
||||
|
||||
String querySql = parseInfo.getSqlInfo().getCorrectS2SQL();
|
||||
return QueryReqBuilder.buildS2SQLReq(querySql, parseInfo.getDataSetId());
|
||||
return QueryReqBuilder.buildS2SQLReq(parseInfo.getSqlInfo(), parseInfo.getDataSetId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.tencent.supersonic.common.pojo.enums.QueryType;
|
||||
import com.tencent.supersonic.common.pojo.enums.TimeDimensionEnum;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaElement;
|
||||
import com.tencent.supersonic.headless.api.pojo.SemanticParseInfo;
|
||||
import com.tencent.supersonic.headless.api.pojo.SqlInfo;
|
||||
import com.tencent.supersonic.headless.api.pojo.request.QueryFilter;
|
||||
import com.tencent.supersonic.headless.api.pojo.request.QueryMultiStructReq;
|
||||
import com.tencent.supersonic.headless.api.pojo.request.QuerySqlReq;
|
||||
@@ -127,6 +128,7 @@ public class QueryReqBuilder {
|
||||
BeanUtils.copyProperties(queryStructReq, req);
|
||||
req.setDataSetId(parseInfo.getDataSetId());
|
||||
req.setDimensionFilters(Lists.newArrayList(dimensionFilter));
|
||||
req.setSqlInfo(parseInfo.getSqlInfo());
|
||||
queryStructReqs.add(req);
|
||||
}
|
||||
queryMultiStructReq.setQueryStructReqs(queryStructReqs);
|
||||
@@ -149,6 +151,16 @@ public class QueryReqBuilder {
|
||||
return querySQLReq;
|
||||
}
|
||||
|
||||
public static QuerySqlReq buildS2SQLReq(SqlInfo sqlInfo, Long dataSetId) {
|
||||
QuerySqlReq querySQLReq = new QuerySqlReq();
|
||||
if (Objects.nonNull(sqlInfo.getCorrectS2SQL())) {
|
||||
querySQLReq.setSql(sqlInfo.getCorrectS2SQL());
|
||||
}
|
||||
querySQLReq.setSqlInfo(sqlInfo);
|
||||
querySQLReq.setDataSetId(dataSetId);
|
||||
return querySQLReq;
|
||||
}
|
||||
|
||||
private static List<Aggregator> getAggregatorByMetric(AggregateTypeEnum aggregateType, SchemaElement metric) {
|
||||
List<Aggregator> aggregators = new ArrayList<>();
|
||||
if (metric != null) {
|
||||
|
||||
Reference in New Issue
Block a user