You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Mousa HAMAD (JIRA)" <ji...@apache.org> on 2019/03/26 11:55:00 UTC

[jira] [Created] (BEAM-6913) Reading data from Spanner never ends

Mousa HAMAD created BEAM-6913:
---------------------------------

             Summary: Reading data from Spanner never ends
                 Key: BEAM-6913
                 URL: https://issues.apache.org/jira/browse/BEAM-6913
             Project: Beam
          Issue Type: Bug
          Components: io-java-gcp
    Affects Versions: 2.11.0
         Environment: macOS Mojave (10.14.3)
            Reporter: Mousa HAMAD


Whenever my pipeline reads from Spanner, the code runs infinitely. If I update the spanner dependency (_com.google.cloud:google-cloud-spanner_) to e.g., _1.11.0,_ then everything works as expected.

Consider the following simple pipeline, which never ends:
{code:java}
public class Prototype_Spanner {

    private static String INSTANCE_ID = "XYZ";
    private static String DATABASE_ID = "test_beam";
    private static String TABLE_NAME = "item";

    private static void runExample() {
        PipelineOptions options = PipelineOptionsFactory.create();
        options.setRunner(DirectRunner.class);

        Pipeline pipeline = Pipeline.create(options);

        pipeline
                .apply("Read", SpannerIO.read()
                        .withInstanceId(INSTANCE_ID)
                        .withDatabaseId(DATABASE_ID)
                        .withTable(TABLE_NAME)
                        .withColumns("price"))
                .apply("Extract Price", MapElements
                        .into(TypeDescriptors.longs())
                        .via((Struct struct) -> struct.getLong("price")))
                .apply("Calculate Mean", Mean.globally())
                .apply("Map to string", MapElements
                        .into(TypeDescriptor.of(String.class))
                        .via(Object::toString))
                .apply("Write", TextIO.write().to("/tmp/output"));

        pipeline.run().waitUntilFinish();
    }

    public static void main(String[] args) {
        runExample();
    }

}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)