[ 
https://issues.apache.org/jira/browse/BEAM-4652?focusedWorklogId=116534&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-116534
 ]

ASF GitHub Bot logged work on BEAM-4652:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Jun/18 18:54
            Start Date: 27/Jun/18 18:54
    Worklog Time Spent: 10m 
      Work Description: kennknowles commented on a change in pull request 
#5788: [BEAM-4652] Pubsub public data
URL: https://github.com/apache/beam/pull/5788#discussion_r198604875
 
 

 ##########
 File path: 
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubReadIT.java
 ##########
 @@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.io.gcp.pubsub;
+
+import static 
org.apache.beam.sdk.transforms.display.DisplayDataMatchers.hasDisplayItem;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.nullValue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+
+import java.util.Set;
+import org.apache.beam.sdk.Pipeline;
+import org.apache.beam.sdk.coders.StringUtf8Coder;
+import org.apache.beam.sdk.io.gcp.pubsub.PubsubIO.Read;
+import org.apache.beam.sdk.options.ValueProvider;
+import org.apache.beam.sdk.options.ValueProvider.StaticValueProvider;
+import org.apache.beam.sdk.testing.TestPipeline;
+import org.apache.beam.sdk.testing.UsesUnboundedPCollections;
+import org.apache.beam.sdk.testing.ValidatesRunner;
+import org.apache.beam.sdk.transforms.display.DisplayData;
+import org.apache.beam.sdk.transforms.display.DisplayDataEvaluator;
+import org.apache.beam.sdk.values.PCollection;
+import org.joda.time.Duration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** Integration test for PubsubIO. */
+@RunWith(JUnit4.class)
+public class PubsubReadIT {
+
+  @Rule public transient TestPubsubSignal signal = TestPubsubSignal.create();
+  @Rule public transient TestPipeline pipeline = TestPipeline.create();
+
+  @Test
+  public void testReadPublicData() throws Exception {
+    PCollection<PubsubMessage> messages =
+        pipeline.apply(
+            PubsubIO.readMessages()
+                
.fromTopic("projects/pubsub-public-data/topics/taxirides-realtime"));
 
 Review comment:
   @rangadi do you know about this?

----------------------------------------------------------------
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: 116534)
    Time Spent: 20m  (was: 10m)

> PubsubIO: create subscription on different project than the topic
> -----------------------------------------------------------------
>
>                 Key: BEAM-4652
>                 URL: https://issues.apache.org/jira/browse/BEAM-4652
>             Project: Beam
>          Issue Type: New Feature
>          Components: io-java-gcp
>            Reporter: Kenneth Knowles
>            Assignee: Kenneth Knowles
>            Priority: Critical
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> If you try to read a public pubsub topic in the DirectRunner, it will fail 
> with 403 when trying to create a subscription. This is because it tries to 
> create a subscription on the shared public data set.
> There is an example used in 
> https://github.com/googlecodelabs/cloud-dataflow-nyc-taxi-tycoon and the 
> dataset is {{projects/pubsub-public-data/topics/taxirides-realtime}}. I 
> discovered that I could not read this in the DirectRunner even though the 
> codelab works. But that 1.x codelab also does not work in the 
> InProcessPipelineRunner, so it has been broken all along.
> So you cannot read public data or any other read-only data using PubsubIO.



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

Reply via email to