You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2021/08/16 17:23:02 UTC
[jira] [Commented] (BEAM-12105) Beam Schema RowCoder can't
roundtrip DateTime
[ https://issues.apache.org/jira/browse/BEAM-12105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17399849#comment-17399849 ]
Beam JIRA Bot commented on BEAM-12105:
--------------------------------------
This issue is P2 but has been unassigned without any comment for 60 days so it has been labeled "stale-P2". If this issue is still affecting you, we care! Please comment and remove the label. Otherwise, in 14 days the issue will be moved to P3.
Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed explanation of what these priorities mean.
> Beam Schema RowCoder can't roundtrip DateTime
> ---------------------------------------------
>
> Key: BEAM-12105
> URL: https://issues.apache.org/jira/browse/BEAM-12105
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Affects Versions: 2.21.0, 2.22.0, 2.23.0, 2.24.0, 2.25.0, 2.26.0, 2.27.0, 2.28.0
> Reporter: Andrew Pilloud
> Priority: P2
> Labels: stale-P2
>
> Beam 2.21.0+ won't roundtrip DateTime. The test was changed in the PR that introduced the breakage: https://github.com/apache/beam/commit/fc6cef9972780ca6b7525d4aadd65a8344221f1b#diff-6dc06eab59c695aaa6c73cf608b392a6a6ab0809e72f1fc3b11805752b8eb69eL68
> This is what doesn't work:
> {code}
> Row.withSchema(...).addValues(inputRow.getDateTime()).build();
> {code}
> Workaround:
> {code}
> Row.withSchema(...).addValues(inputRow.getDateTime().toInstant()).build();
> {code}
> Stack trace:
> {code}
> Caused by: java.lang.ClassCastException: org.joda.time.DateTime cannot be cast to org.joda.time.Instant
> at org.apache.beam.sdk.coders.InstantCoder.encode(InstantCoder.java:34)
> at org.apache.beam.sdk.coders.RowCoderGenerator$EncodeInstruction.encodeDelegate(RowCoderGenerator.java:274)
> at org.apache.beam.sdk.coders.Coder$ByteBuddy$qZItcXc5.encode(Unknown Source)
> at org.apache.beam.sdk.coders.Coder$ByteBuddy$qZItcXc5.encode(Unknown Source)
> at org.apache.beam.sdk.schemas.SchemaCoder.encode(SchemaCoder.java:118)
> at org.apache.beam.sdk.coders.Coder.encode(Coder.java:136)
> at org.apache.beam.sdk.util.CoderUtils.encodeToSafeStream(CoderUtils.java:85)
> at org.apache.beam.sdk.util.CoderUtils.encodeToByteArray(CoderUtils.java:69)
> at org.apache.beam.sdk.util.CoderUtils.encodeToByteArray(CoderUtils.java:54)
> at org.apache.beam.sdk.util.CoderUtils.clone(CoderUtils.java:144)
> at org.apache.beam.sdk.util.MutationDetectors$CodedValueMutationDetector.<init>(MutationDetectors.java:118)
> at org.apache.beam.sdk.util.MutationDetectors.forValueWithCoder(MutationDetectors.java:49)
> at org.apache.beam.runners.direct.ImmutabilityCheckingBundleFactory$ImmutabilityEnforcingBundle.add(ImmutabilityCheckingBundleFacto
> ry.java:115)
> at org.apache.beam.runners.direct.ParDoEvaluator$BundleOutputManager.output(ParDoEvaluator.java:305)
> at org.apache.beam.repackaged.direct_java.runners.core.SimpleDoFnRunner.outputWindowedValue(SimpleDoFnRunner.java:272)
> at org.apache.beam.repackaged.direct_java.runners.core.SimpleDoFnRunner.access$900(SimpleDoFnRunner.java:84)
> at org.apache.beam.repackaged.direct_java.runners.core.SimpleDoFnRunner$DoFnProcessContext.output(SimpleDoFnRunner.java:418)
> at org.apache.beam.repackaged.direct_java.runners.core.SimpleDoFnRunner$DoFnProcessContext.output(SimpleDoFnRunner.java:406)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)