[
https://issues.apache.org/jira/browse/BEAM-5675?focusedWorklogId=157103&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-157103
]
ASF GitHub Bot logged work on BEAM-5675:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Oct/18 19:39
Start Date: 22/Oct/18 19:39
Worklog Time Spent: 10m
Work Description: reuvenlax commented on a change in pull request #6772:
[BEAM-5675] Fix RowCoder#verifyDeterministic
URL: https://github.com/apache/beam/pull/6772#discussion_r227048827
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/coders/RowCoder.java
##########
@@ -123,28 +124,31 @@ public void verifyDeterministic()
private void verifyDeterministic(Schema schema)
throws org.apache.beam.sdk.coders.Coder.NonDeterministicException {
Review comment:
Thanks for the catch! Would it work to replace this with (the simpler):
Iterable<Coder<?>> coders = schema.getFields().stream()
.map(Field::getType).map(RowCoder::coderForFieldType).collect(Collectors.toList());
Coder.verifyDeterministic(this, "All fields must have deterministic
encoding", coders);
Your error message is more descriptive, but maybe better to make the
error-message improvements to Coder.verifyDeterministic. That way all coders
benefit, not just RowCoder. These improvements are separable too - can be done
in a separate PR.
----------------------------------------------------------------
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: 157103)
Time Spent: 1h (was: 50m)
> RowCoder#verifyDeterministic isn't consistent with Beam coders
> --------------------------------------------------------------
>
> Key: BEAM-5675
> URL: https://issues.apache.org/jira/browse/BEAM-5675
> Project: Beam
> Issue Type: Bug
> Components: dsl-sql
> Affects Versions: 2.7.0
> Reporter: Gleb Kanterov
> Assignee: Gleb Kanterov
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> For instance, `DoubleCoder#verifyDeterministic` throws an exception, but
> `RowCoder#verifyDeterministic` doesn't.
> Expected to throw NonDeterministicException
> {code:java}
> RowCoder.of(
> Schema
> .builder()
> .addField("foo", Schema.FieldType.DOUBLE)
> .build()
> ).verifyDeterministic();
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)