[improvement][headless] fixed error sql order item is the same as the agg alias (#1016)

This commit is contained in:
jipeli
2024-05-20 19:37:56 +08:00
committed by GitHub
parent d513b6d2cc
commit 40dc5e2607
3 changed files with 64 additions and 4 deletions

View File

@@ -73,6 +73,10 @@ public class QueryReqConverter {
if (StringUtils.isEmpty(tableName)) {
return new QueryStatement();
}
// correct order item is same as agg alias
String reqSql = querySQLReq.getSql();
querySQLReq.setSql(SqlReplaceHelper.replaceAggAliasOrderItem(querySQLReq.getSql()));
log.info("replaceOrderAggSameAlias {} -> {}", reqSql, querySQLReq.getSql());
//4.build MetricTables
List<String> allFields = SqlSelectHelper.getAllFields(querySQLReq.getSql());
List<MetricSchemaResp> metricSchemas = getMetrics(semanticSchemaResp, allFields);