[
https://issues.apache.org/jira/browse/BEAM-2937?focusedWorklogId=116050&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-116050
]
ASF GitHub Bot logged work on BEAM-2937:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Jun/18 17:27
Start Date: 26/Jun/18 17:27
Worklog Time Spent: 10m
Work Description: lukecwik closed pull request #5536: [BEAM-2937] Add
Combine Grouped Values URN.
URL: https://github.com/apache/beam/pull/5536
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/model/pipeline/src/main/proto/beam_runner_api.proto
b/model/pipeline/src/main/proto/beam_runner_api.proto
index 44e3f427887..bb6f0c72e62 100644
--- a/model/pipeline/src/main/proto/beam_runner_api.proto
+++ b/model/pipeline/src/main/proto/beam_runner_api.proto
@@ -228,17 +228,11 @@ message StandardPTransforms {
// Payload: CombinePayload
COMBINE_GLOBALLY = 1 [(beam_urn) = "beam:transform:combine_globally:v1"];
- // Represents the Combine.groupedValues() operation.
- // If this is produced by an SDK, it is assumed that the SDK understands
- // each of CombineComponents.
- // Payload: CombinePayload
- COMBINE_GROUPED_VALUES = 2 [(beam_urn) =
"beam:transform:combine_grouped_values:v1"];
-
// Represents the Reshuffle operation.
- RESHUFFLE = 3 [(beam_urn) = "beam:transform:reshuffle:v1"];
+ RESHUFFLE = 2 [(beam_urn) = "beam:transform:reshuffle:v1"];
// Less well-known. Payload: WriteFilesPayload.
- WRITE_FILES = 4 [(beam_urn) = "beam:transform:write_files:v1"];
+ WRITE_FILES = 3 [(beam_urn) = "beam:transform:write_files:v1"];
}
// Payload for all of these: CombinePayload
enum CombineComponents {
@@ -249,17 +243,26 @@ message StandardPTransforms {
// Represents the Pre-Combine part of a lifted Combine Per Key, as
described
// in the following document:
//
https://s.apache.org/beam-runner-api-combine-model#heading=h.ta0g6ase8z07
+ // Payload: CombinePayload
COMBINE_PER_KEY_PRECOMBINE = 3 [(beam_urn) =
"beam:transform:combine_per_key_precombine:v1"];
// Represents the Merge Accumulators part of a lifted Combine Per Key, as
// described in the following document:
//
https://s.apache.org/beam-runner-api-combine-model#heading=h.jco9rvatld5m
+ // Payload: CombinePayload
COMBINE_PER_KEY_MERGE_ACCUMULATORS = 4 [(beam_urn) =
"beam:transform:combine_per_key_merge_accumulators:v1"];
// Represents the Extract Outputs part of a lifted Combine Per Key, as
// described in the following document:
//
https://s.apache.org/beam-runner-api-combine-model#heading=h.i9i6p8gtl6ku
+ // Payload: CombinePayload
COMBINE_PER_KEY_EXTRACT_OUTPUTS = 5 [(beam_urn) =
"beam:transform:combine_per_key_extract_outputs:v1"];
+
+ // Represents the Combine Grouped Values transform, as described in the
+ // following document:
+ // https://s.apache.org/beam-runner-api-combine-model#heading=h.aj86ew4v1wk
+ // Payload: CombinePayload
+ COMBINE_GROUPED_VALUES = 6 [(beam_urn) =
"beam:transform:combine_grouped_values:v1"];
}
// Payload for all of these: ParDoPayload containing the user's SDF
enum SplittableParDoComponents {
diff --git
a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/graph/PipelineValidator.java
b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/graph/PipelineValidator.java
index 4e913f9b92c..94cf04ba898 100644
---
a/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/graph/PipelineValidator.java
+++
b/runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/graph/PipelineValidator.java
@@ -56,7 +56,6 @@
// Nothing to validate for MAP_WINDOWS, READ, CREATE_VIEW.
.put(getUrn(Composites.COMBINE_PER_KEY),
PipelineValidator::validateCombine)
.put(getUrn(Composites.COMBINE_GLOBALLY),
PipelineValidator::validateCombine)
- .put(getUrn(Composites.COMBINE_GROUPED_VALUES),
PipelineValidator::validateCombine)
// Nothing to validate for RESHUFFLE and WRITE_FILES
.put(getUrn(CombineComponents.COMBINE_PGBKCV),
PipelineValidator::validateCombine)
.put(
@@ -73,6 +72,7 @@
.put(
getUrn(CombineComponents.COMBINE_PER_KEY_EXTRACT_OUTPUTS),
PipelineValidator::validateCombine)
+ .put(getUrn(CombineComponents.COMBINE_GROUPED_VALUES),
PipelineValidator::validateCombine)
.put(
getUrn(SplittableParDoComponents.PAIR_WITH_RESTRICTION),
PipelineValidator::validateParDo)
diff --git a/sdks/python/apache_beam/transforms/core.py
b/sdks/python/apache_beam/transforms/core.py
index b71c9f00646..783ea29262c 100644
--- a/sdks/python/apache_beam/transforms/core.py
+++ b/sdks/python/apache_beam/transforms/core.py
@@ -1312,11 +1312,11 @@ def to_runner_api_parameter(self, context):
else:
combine_fn = self.fn
return (
- common_urns.composites.COMBINE_GROUPED_VALUES.urn,
+ common_urns.combine_components.COMBINE_GROUPED_VALUES.urn,
_combine_payload(combine_fn, context))
@PTransform.register_urn(
- common_urns.composites.COMBINE_GROUPED_VALUES.urn,
+ common_urns.combine_components.COMBINE_GROUPED_VALUES.urn,
beam_runner_api_pb2.CombinePayload)
def from_runner_api_parameter(combine_payload, context):
return CombineValues(
----------------------------------------------------------------
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: 116050)
Time Spent: 3.5h (was: 3h 20m)
> Fn API combiner support w/ lifting to PGBK
> ------------------------------------------
>
> Key: BEAM-2937
> URL: https://issues.apache.org/jira/browse/BEAM-2937
> Project: Beam
> Issue Type: Improvement
> Components: beam-model
> Reporter: Henning Rohde
> Assignee: Daniel Oliveira
> Priority: Major
> Labels: portability
> Time Spent: 3.5h
> Remaining Estimate: 0h
>
> The FnAPI should support this optimization. Detailed design:
> https://s.apache.org/beam-runner-api-combine-model
> Once design is ready, expand subtasks similarly to BEAM-2822.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)