beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-2170) PubsubIO.readStrings should handle messages without metadata
Date Thu, 04 May 2017 21:14:04 GMT

    [ https://issues.apache.org/jira/browse/BEAM-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15997437#comment-15997437
] 

ASF GitHub Bot commented on BEAM-2170:
--------------------------------------

GitHub user jkff opened a pull request:

    https://github.com/apache/beam/pull/2900

    [BEAM-2170] PubsubMessageWithAttributesCoder should not NPE on messages without attributes

    R: @reuvenlax 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jkff/incubator-beam pubsub-null

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/beam/pull/2900.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2900
    
----
commit 6db4310cf1605cf33592bc11f370c21483d2c86d
Author: Eugene Kirpichov <kirpichov@google.com>
Date:   2017-05-04T21:12:24Z

    [BEAM-2170] PubsubMessageWithAttributesCoder should not NPE on messages without attributes

----


> PubsubIO.readStrings should handle messages without metadata
> ------------------------------------------------------------
>
>                 Key: BEAM-2170
>                 URL: https://issues.apache.org/jira/browse/BEAM-2170
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-gcp
>            Reporter: Alexandre Crayssac
>            Assignee: Eugene Kirpichov
>             Fix For: First stable release
>
>
> When I use PubsubIO.readStrings with messages that does not contain any metadata I got
the following error:
> {noformat}
> java.lang.reflect.InvocationTargetException
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.RuntimeException: org.apache.beam.sdk.coders.CoderException: cannot
encode a null Map
> 	at org.apache.beam.runners.direct.ImmutabilityCheckingBundleFactory$ImmutabilityEnforcingBundle.add(ImmutabilityCheckingBundleFactory.java:113)
> 	at org.apache.beam.runners.direct.UnboundedReadEvaluatorFactory$UnboundedReadEvaluator.processElement(UnboundedReadEvaluatorFactory.java:134)
> 	at org.apache.beam.runners.direct.TransformExecutor.processElements(TransformExecutor.java:138)
> 	at org.apache.beam.runners.direct.TransformExecutor.run(TransformExecutor.java:106)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	... 1 more
> Caused by: org.apache.beam.sdk.coders.CoderException: cannot encode a null Map
> 	at org.apache.beam.sdk.coders.MapCoder.encode(MapCoder.java:90)
> 	at org.apache.beam.sdk.coders.MapCoder.encode(MapCoder.java:43)
> 	at org.apache.beam.sdk.io.gcp.pubsub.PubsubMessageWithAttributesCoder.encode(PubsubMessageWithAttributesCoder.java:53)
> 	at org.apache.beam.sdk.io.gcp.pubsub.PubsubMessageWithAttributesCoder.encode(PubsubMessageWithAttributesCoder.java:33)
> 	at org.apache.beam.sdk.util.CoderUtils.encodeToSafeStream(CoderUtils.java:91)
> 	at org.apache.beam.sdk.util.CoderUtils.encodeToByteArray(CoderUtils.java:75)
> 	at org.apache.beam.sdk.util.CoderUtils.encodeToByteArray(CoderUtils.java:60)
> 	at org.apache.beam.sdk.util.MutationDetectors$CodedValueMutationDetector.<init>(MutationDetectors.java:106)
> 	at org.apache.beam.sdk.util.MutationDetectors.forValueWithCoder(MutationDetectors.java:44)
> 	at org.apache.beam.runners.direct.ImmutabilityCheckingBundleFactory$ImmutabilityEnforcingBundle.add(ImmutabilityCheckingBundleFactory.java:111)
> 	... 8 more
> {noformat}
> When I add some metadata the problem disappears. You should be able to reproduce the
problem with a very simple pipeline consisting of only one PubsubIO.readStrings.
> Tell me if you need more information



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message