Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-12458

Using SubscriberOptions.setPartitions results in pipeline construction error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Triage Needed
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: 2.30.0
    • Fix Version/s: None
    • Component/s: io-java-gcp
    • Labels:
      None

      Description

      With pipeline like:
      ```
      SubscriberOptions subscriberOpitons =
      SubscriberOptions.newBuilder()
      .setSubscriptionPath(SubscriptionPath.parse(""))
      .setPartitions(ImmutableSet.of(Partition.of(0))).build();

      pipeline
      .apply("Create elements", PubsubLiteIO.read(subscriberOpitons))
      ```
      it will fail at pipeline construction time:
      ```
      java.lang.IllegalArgumentException: Unable to infer a coder and no Coder was specified. Please set a coder by invoking Create.withCoder() explicitly or a schema by invoking Create.withSchema().
      at org.apache.beam.sdk.transforms.Create$Values.expand(Create.java:363)
      at org.apache.beam.sdk.transforms.Create$Values.expand(Create.java:277)
      at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:548)
      at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:482)
      at org.apache.beam.sdk.values.PBegin.apply(PBegin.java:44)
      at org.apache.beam.sdk.io.gcp.pubsublite.SubscribeTransform.expand(SubscribeTransform.java:126)
      at org.apache.beam.sdk.io.gcp.pubsublite.SubscribeTransform.expand(SubscribeTransform.java:46)
      at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:548)
      at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:499)
      at org.apache.beam.sdk.values.PBegin.apply(PBegin.java:56)
      at org.apache.beam.sdk.Pipeline.apply(Pipeline.java:192)
      at org.apache.beam.sdk.io.gcp.pubsub.PubsubReadIT.testReadPubsubMessageId(PubsubReadIT.java:72)
      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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.apache.beam.sdk.testing.TestPipeline$1.evaluate(TestPipeline.java:322)
      at org.apache.beam.sdk.io.gcp.pubsub.TestPubsubSignal$1.evaluate(TestPubsubSignal.java:130)
      at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
      at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
      at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
      at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
      at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
      at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
      at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
      at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
      at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
      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.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
      at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
      at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
      at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:119)
      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.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
      at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
      at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide a Coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition.
      Building a Coder using a registered CoderProvider failed.
      See suppressed exceptions for detailed failures.
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:693)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromTypeDescriptor(CoderRegistry.java:622)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoder(CoderRegistry.java:254)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoder(CoderRegistry.java:245)
      at org.apache.beam.sdk.transforms.Create.inferCoderFromObject(Create.java:814)
      at org.apache.beam.sdk.transforms.Create.inferCoderFromObjects(Create.java:744)
      at org.apache.beam.sdk.transforms.Create.getDefaultCreateCoder(Create.java:732)
      at org.apache.beam.sdk.transforms.Create.access$300(Create.java:110)
      at org.apache.beam.sdk.transforms.Create$Values.expand(Create.java:359)
      ... 63 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition is not one of the common types.
      at org.apache.beam.sdk.coders.CoderRegistry$CommonTypes.coderFor(CoderRegistry.java:154)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Class org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition does not have a @DefaultCoder annotation.
      at org.apache.beam.sdk.coders.DefaultCoder$DefaultCoderProviderRegistrar$DefaultCoderProvider.coderFor(DefaultCoder.java:92)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition, this factory can only provide coders for org.apache.beam.sdk.coders.CoderRegistryTest$MyValueA
      at org.apache.beam.sdk.coders.CoderProviders$CoderProviderForCoder.coderFor(CoderProviders.java:183)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition, this factory can only provide coders for org.apache.beam.sdk.coders.CoderRegistryTest$MyValueB
      at org.apache.beam.sdk.coders.CoderProviders$CoderProviderForCoder.coderFor(CoderProviders.java:183)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition, this factory can only provide coders for org.apache.beam.sdk.coders.CoderRegistryTest$AutoRegistrationClass
      at org.apache.beam.sdk.coders.CoderProviders$CoderProviderForCoder.coderFor(CoderProviders.java:183)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition, this factory can only provide coders for com.google.protobuf.ByteString
      at org.apache.beam.sdk.coders.CoderProviders$CoderProviderForCoder.coderFor(CoderProviders.java:183)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Cannot provide ProtoCoder because org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition is not a subclass of com.google.protobuf.Message
      at org.apache.beam.sdk.extensions.protobuf.ProtoCoder$ProtoCoderProvider.coderFor(ProtoCoder.java:334)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition, this factory can only provide coders for com.google.api.services.bigquery.model.TableRow
      at org.apache.beam.sdk.coders.CoderProviders$CoderProviderForCoder.coderFor(CoderProviders.java:183)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition, this factory can only provide coders for org.apache.beam.sdk.io.gcp.pubsub.PubsubMessage
      at org.apache.beam.sdk.coders.CoderProviders$CoderProviderForCoder.coderFor(CoderProviders.java:183)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition, this factory can only provide coders for org.apache.beam.sdk.io.gcp.pubsub.PubsubMessage
      at org.apache.beam.sdk.coders.CoderProviders$CoderProviderForCoder.coderFor(CoderProviders.java:183)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Unable to provide coder for org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition, this factory can only provide coders for org.apache.beam.sdk.io.gcp.pubsub.PubsubMessage
      at org.apache.beam.sdk.coders.CoderProviders$CoderProviderForCoder.coderFor(CoderProviders.java:183)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      Suppressed: org.apache.beam.sdk.coders.CannotProvideCoderException: Cannot provide SerializableCoder because org.apache.beam.sdk.io.gcp.pubsublite.AutoValue_SubscriptionPartition does not implement Serializable
      at org.apache.beam.sdk.coders.SerializableCoder$SerializableCoderProvider.coderFor(SerializableCoder.java:160)
      at org.apache.beam.sdk.coders.CoderRegistry.getCoderFromFactories(CoderRegistry.java:677)
      ... 71 more
      ```

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              boyuanz Boyuan Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: