Google Pub/Sub Pull Subscription
Analytics Plus can stream messages from existing pull subscriptions in a Google Cloud project. After you sign in with Google, Analytics Plus reads messages from the specified subscriptions and adds each message to a stream table as it arrives. One connection can supply several stream tables, with each table reading its own subscriptions.
Note: To have Google send messages to a Push URL, use Google Pub/Sub Push Subscription.
Before you begin
- Stream Analytics is available only in the Enterprise edition of Analytics Plus.
- You need the Project ID of the Google Cloud project and existing subscriptions whose Delivery type is set to Pull.
- The Google account used for authentication must be able to read the subscriptions.
- Messages must be JSON whose keys match the table column names exactly, including case.
Note: Use a subscription that only Analytics Plus reads. If another application consumes from the same subscription, the stream table can miss messages.
Connecting to Google Pub/Sub
- Click Import Your Data at the top-right corner of the Home page.
- Select Streaming Data in the Category list, and click Google Pub/Sub Pull Subscription.
- If the Import Streaming Data into Analytics Plus pane appears, click Proceed.
- Enter a Workspace Name if you started from the Home page.
- Click Authenticate Google and sign in. The message Authenticated with Google successfully confirms the sign-in.
- Enter the Project ID.
- Enter up to three subscription names, pressing Enter after each name, and click Next.

Note:Next remains disabled until authentication succeeds. Click Re-authenticate to use another Google account.
Designing the table
| Option | Use it when | What happens |
| Design table manually | You know the keys and data types. | Add each column yourself. |
| Provide sample data | You have a sample message. | Analytics Plus fills the columns from the JSON. |
| Fetch data automatically from source | Messages are arriving in the subscriptions. | Analytics Plus reads live messages for up to 120 seconds and fills the columns. |

Design the table manually
- Select Design table manually and click Next.
- Add a column for each JSON key and specify its data type.
Provide sample data
- Select Provide sample data.
- Paste a JSON object or array in Provide sample JSON.
- Click Next and review the generated columns.

Fetch data automatically from the source
- Select Fetch data automatically from source.
- Click Fetch Table Metadata. Analytics Plus reads messages for up to 120 seconds.
- When a message arrives, Analytics Plus fills the columns.
Note: If no message arrives within 120 seconds, No data was received for validation appears.
Reviewing table details
- Enter a unique Table Name.
- Review each column's name, data type, mandatory setting, default value, and personal-data setting.
- Add columns if required, and click Next.

Note: Use Decimal Number when a field can contain decimal values.
Validating and importing data
- Optionally set the retention period and turn on Enable Historical Data.
- Confirm that messages are being published to the topics associated with the subscriptions.
- Click Validate & Import Streaming Data. Analytics Plus reads messages for 120 seconds.

After a matching message arrives, the status changes to Consuming Streaming Data. If validation fails, review the Failure Reason(s), correct the issue, and click Validate Again.
Managing the data source
Open Data Sources and select the Google Pub/Sub Pull Subscription source. You can:
- View each table's subscriptions, Last Fetched Time, and Streaming Status.
- Validate, pause, or resume individual tables, or pause and resume all tables.
- Use Edit Setup to change the Project ID or authenticate again.
- Use Add Table to create another table on the same connection.
- Edit a table's subscriptions or retention and review failure details.
Note: A subscription can be read by only one table in the same data source.
Retention and historical tables
- Rows remain in the stream table for one hour by default. Set a retention period from 30 minutes to 24 hours.
- Enable Historical Data creates
{Stream table name} - Historical_Tablefor each stream table. - Turning the option off stops new rows but preserves the historical table and existing data.
Note: Historical table rows count toward the workspace row limit.
Streaming statuses
- Yet to be validated: Awaiting validation.
- Validating: Reading messages for 120 seconds.
- Consuming: Importing data.
- Paused: Import paused.
- Validation Failed: No matching message arrived.
- Failed: Repeated messages could not be processed.
Limits
- A stream table holds up to 1 million rows or one hour of data.
- Each table can read up to three subscriptions.
- Only pull subscriptions are supported; topics and push subscriptions cannot be read directly.
- Stream tables cannot be copied.
- Reports refresh about every 30 seconds; dashboards require a manual refresh.
Frequently asked questions
Why is a subscription name reported as invalid?
The subscription may not exist or may not be a pull subscription. Enter the name of an existing pull subscription rather than a topic name.
Why does Analytics Plus report insufficient permissions?
The signed-in Google account cannot read the subscription. Ask the Google Cloud administrator for access, then click Re-authenticate.
Why does Analytics Plus report that the same credentials already exist?
The connection already exists in the workspace. Open it on the Data Sources page and click Add Table.
Does pausing a stream delete its data?
No. Existing rows remain until the retention period removes them.

