[
https://issues.apache.org/jira/browse/BEAM-12100?focusedWorklogId=647521&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-647521
]
ASF GitHub Bot logged work on BEAM-12100:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Sep/21 18:42
Start Date: 07/Sep/21 18:42
Worklog Time Spent: 10m
Work Description: ibzib commented on a change in pull request #15174:
URL: https://github.com/apache/beam/pull/15174#discussion_r703740164
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/Group.java
##########
@@ -364,19 +365,43 @@
}
}
+ public abstract static class AggregateCombiner<InputT>
+ extends PTransform<PCollection<InputT>, PCollection<Row>> {
+ public abstract <CombineInputT, AccumT, CombineOutputT>
+ AggregateCombiner<InputT> aggregateField(
+ int inputFieldId,
+ CombineFn<CombineInputT, AccumT, CombineOutputT> fn,
+ Field outputField);
+
+ public abstract <CombineInputT, AccumT, CombineOutputT>
+ AggregateCombiner<InputT> aggregateField(
+ String inputFieldName,
+ CombineFn<CombineInputT, AccumT, CombineOutputT> fn,
+ Field outputField);
+
+ public abstract <CombineInputT, AccumT, CombineOutputT>
+ AggregateCombiner<InputT> aggregateFieldsById(
+ List<Integer> inputFieldIds,
+ CombineFn<CombineInputT, AccumT, CombineOutputT> fn,
+ Field outputField);
+ }
+
/**
* a {@link PTransform} that does a global combine using an aggregation
built up by calls to
* aggregateField and aggregateFields. The output of this transform will
have a schema that is
* determined by the output types of all the composed combiners.
*/
- public static class CombineFieldsGlobally<InputT>
- extends PTransform<PCollection<InputT>, PCollection<Row>> {
+ public static class CombineFieldsGlobally<InputT> extends
AggregateCombiner<InputT> {
private final SchemaAggregateFn.Inner schemaAggregateFn;
CombineFieldsGlobally(SchemaAggregateFn.Inner schemaAggregateFn) {
this.schemaAggregateFn = schemaAggregateFn;
}
+ public static CombineFieldsGlobally initialCombiner() {
Review comment:
Add a javadoc comment for this method.
Also consider renaming it to something more standard. Factory methods like
this are usually just called `create` (like `SchemaAggregateFn.create()`) so we
can follow that pattern here.
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/Group.java
##########
@@ -364,19 +365,43 @@
}
}
+ public abstract static class AggregateCombiner<InputT>
Review comment:
Add a javadoc comment for this interface and its methods.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 647521)
Time Spent: 9h 20m (was: 9h 10m)
> SUM should error when overflow/underflow occurs.
> ------------------------------------------------
>
> Key: BEAM-12100
> URL: https://issues.apache.org/jira/browse/BEAM-12100
> Project: Beam
> Issue Type: Bug
> Components: dsl-sql-zetasql
> Reporter: Kyle Weaver
> Assignee: Benjamin Gonzalez
> Priority: P3
> Time Spent: 9h 20m
> Remaining Estimate: 0h
>
> SELECT SUM(col1) FROM (SELECT CAST(9223372036854775807 as int64) as col1
> UNION ALL SELECT CAST(1 as int64))
> should return an error.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)