[
https://issues.apache.org/jira/browse/BEAM-5674?focusedWorklogId=166607&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-166607
]
ASF GitHub Bot logged work on BEAM-5674:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Nov/18 19:25
Start Date: 15/Nov/18 19:25
Worklog Time Spent: 10m
Work Description: rohdesamuel opened a new pull request #7054:
[BEAM-5674] Add withKeyType to DataflowRunner.Deduplicate internals
URL: https://github.com/apache/beam/pull/7054
This fixes the attached JIRA by explicitly typing the key as integer.
------------------------
Follow this checklist to help us incorporate your contribution quickly and
easily:
- [x] Format the pull request title like `[BEAM-XXX] Fixes bug in
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA
issue, if applicable. This will automatically link the pull request to the
issue.
- [x] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
It will help us expedite review of your Pull Request if you tag someone
(e.g. `@username`) to look at it.
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
--- | --- | --- | --- | --- | --- | --- | ---
Go | [](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/)
| --- | --- | --- | --- | --- | ---
Java | [](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/)
[](https://builds.apache.org/job/beam_PostCommit_Java_PVR_Flink/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/)
Python | [](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/)
| --- | [](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)
</br> [](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Python_VR_Flink/lastCompletedBuild/)
| --- | --- | ---
----------------------------------------------------------------
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: 166607)
Time Spent: 10m
Remaining Estimate: 0h
> DataflowRunner.Deduplicate/WithKeys cannot infer Coder for K when running
> with experiment "enable_custom_pubsub_source"
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: BEAM-5674
> URL: https://issues.apache.org/jira/browse/BEAM-5674
> Project: Beam
> Issue Type: Bug
> Components: runner-dataflow
> Affects Versions: 2.7.0
> Environment: OS: Linux 64bit,
> Platform: Dataflow
> Reporter: Duy Le
> Assignee: Sam Rohde
> Priority: Major
> Labels: easyfix, patch
> Time Spent: 10m
> Remaining Estimate: 0h
>
> *Bug*: DataflowRunner.Deduplicate/WithKeys cannot infer Coder for K when
> running with experiment "enable_custom_pubsub_source"
> *Steps*
> # Start a Beam pipeline with DataflowRunner using
> ExperimentalOptions."enable_custom_pubsub_source"
> # Observe the result when the pipeline is being constructed.
> *Actual*: An error thrown
> {color:#FF0000}Unable to return a default Coder for
> PubsubIO.Read/PubsubUnboundedSource/Read(PubsubSource)/DataflowRunner.Deduplicate/WithKeys/AddKeys/Map/ParMultiDo(Anonymous).output
> [PCollection]. Correct one of the following root causes:{color}
> {color:#FF0000} No Coder has been manually specified; you may do so using
> .setCoder().{color}
> {color:#FF0000} Inferring a Coder from the CoderRegistry failed: Cannot
> provide coder for parameterized type org.apache.beam.sdk.values.KV<K, V>:
> Unable to provide a Coder for K.{color}
> {color:#FF0000} Building a Coder using a registered CoderProvider
> failed.{color}
> *Expected*: The pipeline should be constructed successfully.
> *Root cause*:
> In
> {noformat}
> DataflowRunner.Deduplicate{noformat}
> transform, it applies
> {code:java}
> WithKeys.of(){code}
> transform to an input of *ValueWithRecordId* with a function in the style of
> Java 8 lambda.
>
>
> As the Javadoc states that:
>
> {code:java}
> If using a lambda in Java 8, {@link #withKeyType(TypeDescriptor)} must be
> called on the result {@link PTransform}{code}
>
> *Suggested Solution*:
> Since the lambda function returns a hashed code (_int_) of the
> {code:java}
> value.getId(){code}
> (_byte[]_), can we just use
> {code:java}
> withKeyType(TypeDescriptors.integers()){code}
> right after the
> {code:java}
> WithKeys.of(){code}
> method?
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)