(improvement)(chat) Special handling for count_distinct operator during SQL correcting and explaining (#320)

This commit is contained in:
yangde
2023-11-04 12:58:25 +08:00
committed by GitHub
parent b8989e204f
commit 2fe56e7462
4 changed files with 121 additions and 2 deletions

View File

@@ -125,7 +125,8 @@ public class QueryReqConverter {
// if there is count() in S2QL,set MetricTable's aggOption to "NATIVE"
String sql = databaseReq.getSql();
if (!SqlParserSelectHelper.hasGroupBy(sql)
|| SqlParserSelectFunctionHelper.hasFunction(sql, "count")) {
|| SqlParserSelectFunctionHelper.hasFunction(sql, "count")
|| SqlParserSelectFunctionHelper.hasFunction(sql, "count_distinct")) {
return AggOption.NATIVE;
}
return AggOption.DEFAULT;