[
https://issues.apache.org/jira/browse/BEAM-4461?focusedWorklogId=160785&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-160785
]
ASF GitHub Bot logged work on BEAM-4461:
----------------------------------------
Author: ASF GitHub Bot
Created on: 30/Oct/18 19:02
Start Date: 30/Oct/18 19:02
Worklog Time Spent: 10m
Work Description: reuvenlax commented on a change in pull request #6883:
[BEAM-4461] Resubmit PR to switch SQL over to schema transfomr
URL: https://github.com/apache/beam/pull/6883#discussion_r229445094
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamAggregationRel.java
##########
@@ -118,58 +114,51 @@ public RelWriter explainTerms(RelWriter pw) {
@Override
public PTransform<PCollectionList<Row>, PCollection<Row>> buildPTransform() {
- Schema inputSchema = CalciteUtils.toSchema(getInput().getRowType());
Schema outputSchema = CalciteUtils.toSchema(getRowType());
- List<AggregationCombineFnAdapter> aggregationAdapters =
+ List<FieldAggregation> aggregationAdapters =
getNamedAggCalls()
.stream()
- .map(aggCall -> AggregationCombineFnAdapter.of(aggCall,
inputSchema))
+ .map(aggCall -> new FieldAggregation(aggCall.getKey(),
aggCall.getValue()))
.collect(toList());
return new Transform(
- windowFn, windowFieldIndex, inputSchema, getGroupSet(),
aggregationAdapters, outputSchema);
+ windowFn, windowFieldIndex, getGroupSet(), aggregationAdapters,
outputSchema);
+ }
+
+ private static class FieldAggregation implements Serializable {
+ final List<Integer> inputs;
+ final CombineFn combineFn;
+ final Field outputField;
Review comment:
AggregationCombineFnAdapter is simply a factory that returns (possibly
multiple) combiners. This is the only container class.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 160785)
Time Spent: 15h 50m (was: 15h 40m)
> Create a library of useful transforms that use schemas
> ------------------------------------------------------
>
> Key: BEAM-4461
> URL: https://issues.apache.org/jira/browse/BEAM-4461
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-java-core
> Reporter: Reuven Lax
> Assignee: Reuven Lax
> Priority: Major
> Time Spent: 15h 50m
> Remaining Estimate: 0h
>
> e.g. JoinBy(fields). Project, Filter, etc.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)