[ https://issues.apache.org/jira/browse/BEAM-11808?focusedWorklogId=701646&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-701646 ]
ASF GitHub Bot logged work on BEAM-11808: ----------------------------------------- Author: ASF GitHub Bot Created on: 28/Dec/21 19:03 Start Date: 28/Dec/21 19:03 Worklog Time Spent: 10m Work Description: benWize commented on a change in pull request #16200: URL: https://github.com/apache/beam/pull/16200#discussion_r776037458 ########## File path: sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/AggregateScanConverter.java ########## @@ -148,24 +149,27 @@ private LogicalProject convertAggregateScanInputScanToLogicalProject( // aggregation? ResolvedAggregateFunctionCall aggregateFunctionCall = ((ResolvedAggregateFunctionCall) resolvedComputedColumn.getExpr()); - if (aggregateFunctionCall.getArgumentList() != null - && aggregateFunctionCall.getArgumentList().size() == 1) { - ResolvedExpr resolvedExpr = aggregateFunctionCall.getArgumentList().get(0); - - // TODO: assume aggregate function's input is either a ColumnRef or a cast(ColumnRef). - // TODO: user might use multiple CAST so we need to handle this rare case. - projects.add( - getExpressionConverter() - .convertRexNodeFromResolvedExpr( - resolvedExpr, - node.getInputScan().getColumnList(), - input.getRowType().getFieldList(), - ImmutableMap.of())); - fieldNames.add(getTrait().resolveAlias(resolvedComputedColumn.getColumn())); - } else if (aggregateFunctionCall.getArgumentList() != null - && aggregateFunctionCall.getArgumentList().size() > 1) { - throw new IllegalArgumentException( - aggregateFunctionCall.getFunction().getName() + " has more than one argument."); + ImmutableList<ResolvedExpr> argumentList = Review comment: It wasn't needed, fixed it -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 701646) Time Spent: 1h 50m (was: 1h 40m) > ZetaSQL layer doesn't support aggregate functions with two arguments > --------------------------------------------------------------------- > > Key: BEAM-11808 > URL: https://issues.apache.org/jira/browse/BEAM-11808 > Project: Beam > Issue Type: Improvement > Components: dsl-sql-zetasql > Reporter: Sonam Ramchand > Assignee: Benjamin Gonzalez > Priority: P3 > Time Spent: 1h 50m > Remaining Estimate: 0h > > Blocked by: parsed ZetaSQL to a Calcite logical expression doesn't currently > support aggregate functions with multiple columns. > [https://github.com/apache/beam/blob/3bb232fb098700de408f574585dfe74bbaff7230/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/AggregateScanConverter.java#L147] -- This message was sent by Atlassian Jira (v8.20.1#820001)