Skip to content

Commit

Permalink
chore: ignore argument list for COUNT function as it is just converte…
Browse files Browse the repository at this point in the history
…d to COUNT(*) at the end (#175)
  • Loading branch information
saxenakshitiz authored Sep 22, 2022
1 parent 4c5a954 commit 7763d2a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.hypertrace.core.query.service;

import static org.hypertrace.core.query.service.QueryFunctionConstants.QUERY_FUNCTION_COUNT;
import static org.hypertrace.core.query.service.QueryRequestUtil.getAlias;
import static org.hypertrace.core.query.service.QueryRequestUtil.getLogicalColumnName;
import static org.hypertrace.core.query.service.api.Expression.ValueCase.ATTRIBUTE_EXPRESSION;
Expand Down Expand Up @@ -171,6 +172,10 @@ private void extractColumns(List<String> columns, Expression expression) {
break;
case FUNCTION:
Function function = expression.getFunction();
// ignore argument list for COUNT function as it is just converted to COUNT(*) at the end
if (function.getFunctionName().equalsIgnoreCase(QUERY_FUNCTION_COUNT)) {
break;
}
for (Expression childExpression : function.getArgumentsList()) {
extractColumns(columns, childExpression);
}
Expand Down

0 comments on commit 7763d2a

Please sign in to comment.